Issue with Transforming Transpose and Mul Layers in CNN Model #1200
Replies: 2 comments 3 replies
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
@fpjentzsch I am @Nishith0402 's teammate in the project. As you suggested, I have modified my CNN. Now for estimating the reports, all the transformations are working. But I observed that the input and output layers are removed when the onnx transformation happens as mentioned by you earlier. After tidy up transformation my onnx has an input layer After streamline transformation transpose is introduced in the input. Could you explain why this is happening and suggest any modifications to prevent this. Also after creating the dataflow partition my input and output layer are removed as shown below: (I suppose it is because of the transpose in the input and add matmul and mul in the output which cause this removal. Any suggestions to prevent this) So, I don't understand why my input and output layers are removed. Please help us out in understanding why these are happening. Also, when I try to generate hardware, I get an hls error |
Beta Was this translation helpful? Give feedback.
-
I am working with a CNN model in ONNX format. However, I am facing an issue with the transformation of a Transpose layer in my CNN model in ONNX format. After applying the streamline and convert_to_hw transformations in FINN, a Transpose layer is automatically added to convert the data format from channels-first (NCHW) to channels-last (NHWC). Even when I modify the ONNX model to use the channels-last (NHWC) format from the beginning, the Transpose layer still gets added during the transformation steps.
Additionally,there is another Transpose layer followed by a Flatten layer, and I was unable to absorb the Transpose layer into the Flatten layer using "AbsorbTransposeIntoFlatten() ".And also I am encountering an issue at the final stage where a Mul layer needs to be converted into a Thresholding layer, but the transformation does not take place as expected.After the convert_to_hw transformation, the create_dataflow_partition function throws an error: "cycle-free graph violated: partition depends on itself."
Initial Transpose Layer:
Transpose layer followed by flatten:
Is there a way to prevent streamline and convert_to_hw from automatically adding this Transpose layer and convert mul layer to thresholding layer at the output?
I’m looking for suggestions on how to manage these transformations and optimize the affected layers more efficiently using FINN.
Beta Was this translation helpful? Give feedback.
All reactions