Verilog Code generation for my ONNX Model
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have my pretrained pytorch file best.pt and i converted file into ONNX Format . How can i generate verilog code for this File. How can i optimize the Model for my resources in FPGA ? Planning to implement in Zynq Ultrascale MpSoC + Boards
0 Commenti
Risposte (1)
Subhajyoti
il 29 Ott 2024
It is my understanding that you are trying to generate Verilog code for the ONNX file, and later, planning to deploy it on FPGA boards.
HDL Coder can generate portable, synthesizable Verilog code from MATLAB functions, Simulink models, and Stateflow charts. But currently, the HDL Coder does not support code generation for the function 'importNetworkFromONNX'.
Alternatively, you can create a custom processor configuration and estimate the performance of a pretrained series network. You can then modify parameters of the custom processor configuration and re-estimate the performance. Once you have achieved your performance requirements you can generate a custom bitstream by using the custom processor configuration.
Here, in the following implementation, I have loaded a network from an ONNX file.
% [squeezeNet,ClassNames] = imagePretrainedNetwork("squeezenet");
% exportONNXNetwork(squeezeNet,"squeezeNet.onnx");
net = importNetworkFromONNX("squeezeNet.onnx");
analyzeNetworkForCodegen(net)
You can create, compile, and deploy a 'dlhdl.Workflow' object with the network object by using the Deep Learning HDL Toolbox. Use MATLAB to retrieve the prediction results from the target device. The steps are thoroughly illustrated in the following example:
Additionally, you can refer to the following resources to know more about Custom Deep Learning Processor Generation to Meet Performance Requirements:
2 Commenti
子浩
il 31 Ott 2024
Thank you very for your help. I have a similar question. I want to deploy my trained CNN network (.pt) onto an FPGA platform, and my development board is ZedBoard instead of ZCU102. Do you know if MATLAB supports this type of deployment? Thank you.
Manikanta Aditya
il 13 Nov 2024
Modificato: Manikanta Aditya
il 13 Nov 2024
Yes, MATLAB does support deploying trained convolutional neural networks (CNNs) onto FPGA platforms. You can use the Deep Learning HDL Toolbox in MATLAB to create, compile, and deploy your CNNs.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!