RuntimeError: 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__:

hi
I’m trying to convert yolov4 pytorch model to Torchscript but i faced with this error.
my model convert and saved but it does not work.

Fusing layers… Model Summary: 235 layers, 5.25029e+07 parameters, 5.04494e+07 gradients
/pqc_yolov4/models/yolo.py:41: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can’t record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
if self.grid[i].shape[2:4] != x[i].shape[2:4]:
/opt/conda/lib/python3.8/site-packages/torch/jit/_trace.py:950: TracerWarning: Encountering a list at the output of the tracer might cause the trace to be incorrect, this is only valid if the container structure does not change based on the module’s inputs. Consider using a constant container instead (e.g. for list, use a tuple instead. for dict, use a NamedTuple instead). If you absolutely need this and know the side effects, pass strict=False to trace() to allow this behavior.
module._c._create_method_from_trace(
Traceback (most recent call last):
File “pqc_Torchscript.py”, line 29, in
torch.jit.save(traced_gpu, “./pqc_result/final_model__new_TorchScript.pt”)
File “/opt/conda/lib/python3.8/site-packages/torch/jit/_serialization.py”, line 81, in save
m.save(f, _extra_files=_extra_files)
File “/opt/conda/lib/python3.8/site-packages/torch/jit/_script.py”, line 495, in save
return self._c.save(str(f), **kwargs)
RuntimeError:
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:
/opt/conda/lib/python3.8/site-packages/mish_cuda/init.py(20): forward
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py(860): _slow_forward
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py(887): _call_impl
/pqc_yolov4/models/common.py(34): fuseforward
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py(860): _slow_forward
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py(887): _call_impl
/pqc_yolov4/models/yolo.py(129): forward_once
/pqc_yolov4/models/yolo.py(109): forward
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py(860): _slow_forward
/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py(887): _call_impl
/opt/conda/lib/python3.8/site-packages/torch/jit/_trace.py(950): trace_module
/opt/conda/lib/python3.8/site-packages/torch/jit/_trace.py(733): trace
pqc_Torchscript.py(28):