Convert yolov5s.onnx failed, report "IndexError: Input model.0.conv.conv.weight is undefined!"
yank666 opened this issue · 5 comments
I just convert yolov5s in onnx format by convert.py, but always report error "IndexError: Input model.0.conv.conv.weight is undefined!", I sure the yolov5s.onnx is no problem which is export follow "https://github.com/ultralytics/yolov5", can you help me resolve this error. the dependency of mace is same with guide
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- NDK version(e.g., 15c):
- GCC version(if compiling for host, e.g., 5.4.0):
- MACE version (Use the command: git describe --long --tags):
- Python version(2.7):
- Bazel version (e.g., 0.13.0):
Model deploy file (*.yml)
......
Describe the problem
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the problem:
1. cd /path/to/mace
2. python tools/converter.py convert --config_file=/path/to/your/model_deployment_file
Error information / logs
Please include the full log and/or traceback here.
LOGs
Additional context
Add any other context about the problem here, e.g., what you have modified about the code.
@yank666 This is a onnx check issue, you can add "keep_initializers_as_inputs=True" into torch.onnx.export().
@yank666 This is a onnx check issue, you can add "keep_initializers_as_inputs=True" into torch.onnx.export().
where is torch.onnx.export(), I can't find it in onnx_converter.py. No where torch.onnx.export() is called , i
just find 'onnx.utils.polish_model(onnx_model)' in onnx_converter.py. PLS help, describe it in more detail
You can find it at your export pytorch model to onnx model code.
You can find it at your export pytorch model to onnx model code.
Ok, i have a try, thx
You can find it at your export pytorch model to onnx model code.
ok, I success in convert model, thx.
By the way, when I got multi input or output in model , the intput_tensors(output_tensors) and input_shapes(output_shapes) in *.yml