Eric3911 / ScaledYOLOv4

56 stars 7 forks source link

Export onnx model error #1

Open thanhpt93 opened 3 years ago

thanhpt93 commented 3 years ago

This below error occur when I run export.py. Could you check it? Thank you very much!

TorchScript export failure: Could not export Python function call 'MishCudaFunction'. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList, add it to constants: /root/miniconda3/lib/python3.7/site-packages/mish_cuda-0.0.3-py3.7-linux-x86_64.egg/mish_cuda/init.py(20): forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl /root/tool/ScaledYOLOv4/models/common.py(31): forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl /root/tool/ScaledYOLOv4/models/yolo.py(129): forward_once /root/tool/ScaledYOLOv4/models/yolo.py(109): forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl /root/miniconda3/lib/python3.7/site-packages/torch/jit/_trace.py(940): trace_module /root/miniconda3/lib/python3.7/site-packages/torch/jit/_trace.py(742): trace export.py(34):

Eric3911 commented 3 years ago

ths

This below error occur when I run export.py. Could you check it? Thank you very much!

TorchScript export failure: Could not export Python function call 'MishCudaFunction'. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList, add it to constants: /root/miniconda3/lib/python3.7/site-packages/mish_cuda-0.0.3-py3.7-linux-x86_64.egg/mish_cuda/init.py(20): forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl /root/tool/ScaledYOLOv4/models/common.py(31): forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl /root/tool/ScaledYOLOv4/models/yolo.py(129): forward_once /root/tool/ScaledYOLOv4/models/yolo.py(109): forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(709): _slow_forward /root/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py(725): _call_impl /root/miniconda3/lib/python3.7/site-packages/torch/jit/_trace.py(940): trace_module /root/miniconda3/lib/python3.7/site-packages/torch/jit/_trace.py(742): trace export.py(34):

ths for me, read you question, i guss this is a python package version issue

Eric3911 commented 3 years ago

This is a python package version issue