IndexError: list assignment index out of range
🐞Describe the bug
convert onnx to coreml for yolact(with slice, topK ops)
Trace
345/361: Converting Node Type Gather
346/361: Converting Node Type Gather
347/361: Converting Node Type Concat
348/361: Converting Node Type Concat
349/361: Converting Node Type TopK
350/361: Converting Node Type Slice
Traceback (most recent call last):
File "/home/jiapy/workspace/yolact/model_convert.py", line 223, in
Process finished with exit code 1
To Reproduce
- If a python script can reproduce the error, please paste the code snippet
from onnx_coreml import convert
# Paste code snippet here
model_onnx = onnx.load("./yolact_test.onnx") print('----convert model to onnx success. ') # output_onnx = model_onnx(input_onnx)
onnx.checker.check_model(model_onnx)
# Print a human readable representation of the graph
# onnx.helper.printable_graph(model.graph)
print('----convert model to onnx success. 22')
# add onnx2coreml conversion part, input_names same as onnx'
coreml_model = onnx_coreml.convert(model_onnx,
None,
# image_input_names=['image']
minimum_ios_deployment_target='13',
add_custom_layers=True,
# custom_conversion_functions={"Slice": _convert_slice}
# disable_coreml_rank5_mapping=True
)
coreml_model.save("./yolact_test.mlmodel")
- If applicable, please attach ONNX model
- If model cannot be shared publicly, please attach it via filing a bug report at https://developer.apple.com/bug-reporting/
- If model conversion succeeds, however, there is numerical mismatch between the original and the coreml model, please paste python script used for comparison (pytorch code, onnx runtime code etc.)
System environment (please complete the following information):
- coremltools version (3.3):
- onnx-coreml version (1.2):
- OS (Linux):
- How you install python ( virtualenv):
- python version (e.g. 3.6): -pytorch 1.2
- any other relevant information:
Additional context
error occured after TopK ops
@bhushan23 Do you have some advice for this issue?
@dzyjjpy apologies for delayed response. What is your ONNX opset version for given model?
according to https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Slice-1 Slice should have one input and in that case slice start and end indices should be present for all given axes, which is the assumption for slice ir v9 variant. If it's opset version 10 then it should have more than one inputs.
Sharing onnx model here would be useful.