Solved by birds_are_drones in post #5 
              
              
                Thans for your help @ptrblck 
I have finally found a way to do so. 
As you said,  my model was indeed not traced and this is what led to the error. 
I used this repos to transform my onnx module to a pytorch traced module with the following unfininshed-but-you-get-the-idea script that converts onnx …