onnx-pytorch icon indicating copy to clipboard operation
onnx-pytorch copied to clipboard

OpCodeGenerator is unimplemented for Softplus

Open juhan opened this issue 2 years ago • 1 comments

When trying to convert a Yolov4 ONNX model with onnx-pytorch I get the following error. Seems to be an unimplemented OpCode for Softplus.

WARNING:root:Cannot get default value for dilations of Conv. WARNING:root:Cannot get default value for kernel_shape of Conv. WARNING:root:Cannot get default value for pads of Conv. WARNING:root:Cannot get default value for strides of Conv. Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/someenv/lib/python3.8/site-packages/onnx_pytorch/code_gen.py", line 378, in main() File "/someenv/python3.8/site-packages/onnx_pytorch/code_gen.py", line 368, in main gen(onnx_model=args.onnx_model_path, File "/someenv/python3.8/site-packages/onnx_pytorch/code_gen.py", line 291, in gen model_code_generator.run() File "/someenv/python3.8/site-packages/onnx_pytorch/code_gen.py", line 246, in run raise NotImplementedError( NotImplementedError: OpCodeGenerator is unimplemented for Softplus.

Installed version:

pip show onnx_pytorch Name: onnx-pytorch Version: 0.1.4 Summary: Convert ONNX to PyTorch code. Home-page: https://github.com/fumihwh/onnx-pytorch Author: fumihwh Author-email: [email protected] License: Apache 2.0 Location: /someenv/lib/python3.8/site-packages Requires: torchvision, setuptools, torch, PyYAML, tqdm, onnxruntime, onnx, sympy, pytest, numpy Required-by:

juhan avatar Apr 07 '22 08:04 juhan

Hi, @juhan could you add support for this op? Contribution is welcome! Just follow the PRelu, I think it could help.

fumihwh avatar Apr 14 '22 13:04 fumihwh