Error using dlquantizer/validate- Out of memory - an infinite recursion within the program

4 visualizaciones (últimos 30 días)
I am using the deep learning hdl toolbox to accelerate a deep learning model on FPGA. I have a very lightwaeight model using depthwise layers but when i try to validate and combile the model for hardware, I get the Error:
Error using dlquantizer/validate
Out of memory. The likely cause is an infinite recursion within the program
I dont understand what could be the issue. Any help please?
dlQuantObj = dlquantizer(net,'ExecutionEnvironment',"FPGA");
%% Create Target Object (Hardware Device)
hTarget = dlhdl.Target("Xilinx",Interface="Ethernet",IPAddress="");
% >> hTarget.validateConnection
%% Validation
options_FPGA = dlquantizationOptions('Bitstream','zcu102_int8','Target',hTarget);
% dlquantizationOptions: default metric function is a Top-1 accuracy metric function
prediction_FPGA = dlQuantObj.validate(imdsValidation,options_FPGA)

Respuestas (1)

Siraj el 4 de Dic. de 2023
Editada: Siraj el 4 de Dic. de 2023
It is my understanding that you have a deep learning network that you want to deploy on an FPGA, you use the "dlquantizer" function to reduce the network's memory requirements. However, at this stage, you encounter the following error: "Error using dlquantizer/validate - Out of memory."
As I don't have the architecture of your model or the script causing the error, it's challenging to pinpoint the exact reason for the issue. However, considering that your model includes depthwise concatenation layers, it's worth noting that for int8 data type quantization, Deep Learning HDL Toolbox offers support for depth concatenation only after the R2021b release. If you are using a previous version of MATLAB, this might be the cause of the issue. You can verify this by checking the "Updated supported layers" section in the following link:
If you are using the correct version of MATLAB, an out of memory error typically indicates that the CPU/GPU on the machine may not have sufficient resources to support dlquantizer/validate. If you are using a GPU, you can try the following steps: First, run
>> gpuDevice()
and check if the problem persists. If it does, reset the GPU by calling.
>> gpuDevice(1)
This might help, as there could be other processes consuming GPU memory on the machine.
Check if all the layers in your network are supported for int8 quantization or not. You can refer to the following link to verify this:
To further debug the problem, consider creating smaller versions of your network by removing some layers, reducing the input size, or both, to see if you encounter the same error.
For additional support, you can reach out to MathWorks through this link:
Hope this helps
  1 comentario
Obed Mogaka
Obed Mogaka el 6 de Dic. de 2023
Thank you for you guidance.
This was usefull. I learned I had an unsuported configuration of the depthwise convolution. I was using dilation > 1, and after changing this, I resolved the error.

Iniciar sesión para comentar.


Más información sobre Deep Learning INT8 Quantization en Help Center y File Exchange.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by