-
hi all, i am a new learner here. Today i was tring to load a torch CNN model, and transfer it to FPGA firmware. i managed to finish other steps, until i got this error. please see log.txt for the full information showed in terminal. Also i attached .py file that i'm running. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
when i look into the log.txt, i found the first error is that: ../../../../firmware/my_hls_projectCNN.cpp:49:5: error: 'conv_2d_cf' is not a member of 'nnet'. |
Beta Was this translation helpful? Give feedback.
-
hls4ml implements CNN layers expecting a "channels last" format (also known as |
Beta Was this translation helpful? Give feedback.
hls4ml implements CNN layers expecting a "channels last" format (also known as
(N, H, W, C)
) which is used by Keras/TF. PyTorch by default uses "channels first" format (or(N, C, H, W)
in other terminology. These use the suffix_cf
in the code and are not implemented. You can instruct hls4ml to convert to "channels last" and expect input data to be in that format (and optionally the output if needed). Check the optionsInputsChannelLast
andTransposeOutputs
of theconfig_from_pytorch_model
. Also, you're likely using older version of hls4ml, try installing the main branch (soon to become 1.0). Mixing and matching random .h files from various forks will likely not work 😄