-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
converting 'cat' operation #2296
Comments
Could you provide a code snippet for reproducing this? Thanks! |
Here is a colab notebook to reproduce the issue. https://colab.research.google.com/drive/191HxvCwjIFlUIT3gOBPl7YGUZNnUZTJi?usp=sharing, there are two issues:
PLEASE RESTART THE NOTEBOOK AFTER THIS CHANGE.
I hope this will help reproduce. Please let me know if you need anything else. |
Any updates yet? |
Thank you for providing the detailed steps to reproduce! I can reproduce the issue. We are investigating on the root cause of this bug. |
🐞Describing the bug
While converting from detectron2 model to coreml, got the following error:
ValueError: dtypes needs to be a list/tuple of at least 1 element
Stack Trace
ERROR - converting 'cat' op (located at: 'roi_heads/box_pooler'):
Converting PyTorch Frontend ==> MIL Ops: 75%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 1426/1891 [00:00<00:00, 1685.47 ops/s]
Traceback (most recent call last):
File "/home/user/Desktop/drive/segmentation/model/torch2coreml.py", line 12, in
mlmodel = ct.converters.convert(
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/_converters_entry.py", line 581, in convert
mlmodel = mil_convert(
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/converter.py", line 188, in mil_convert
return _mil_convert(model, convert_from, convert_to, ConverterRegistry, MLModel, compute_units, **kwargs)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/converter.py", line 212, in _mil_convert
proto, mil_program = mil_convert_to_proto(
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/converter.py", line 288, in mil_convert_to_proto
prog = frontend_converter(model, **kwargs)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/converter.py", line 108, in call
return load(*args, **kwargs)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/load.py", line 82, in load
return _perform_torch_convert(converter, debug)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/load.py", line 116, in _perform_torch_convert
prog = converter.convert()
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/converter.py", line 581, in convert
convert_nodes(self.context, self.graph)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/ops.py", line 86, in convert_nodes
raise e # re-raise exception
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/ops.py", line 81, in convert_nodes
convert_single_node(context, node)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/ops.py", line 134, in convert_single_node
add_op(context, node)
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/frontend/torch/ops.py", line 2115, in cat
values=promote_input_dtypes(xs), axis=axis, name=node.name
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/mil/ops/defs/_utils.py", line 452, in promote_input_dtypes
promoted_dtype = promote_dtypes([var.dtype for var in input_vars])
File "/home/user/anaconda3/envs/coreml/lib/python3.10/site-packages/coremltools/converters/mil/mil/types/type_mapping.py", line 264, in promote_dtypes
raise ValueError("dtypes needs to be a list/tuple of at least 1 element")
ValueError: dtypes needs to be a list/tuple of at least 1 element
System environment (please complete the following information):
Additional context
KeyError: 4
for the full operation, to counter that, i copied code from the latest beta release for the full operation. the copied code:The text was updated successfully, but these errors were encountered: