Skip to content
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

CoreML export failure: unexpected number of inputs for node x.2 (_convolution): 13 #1945

Closed
Nabyssache opened this issue Jan 15, 2021 · 7 comments
Labels
bug Something isn't working Stale Stale and schedule for closing soon

Comments

@Nabyssache
Copy link

Additional context

issue occur:
Converting Frontend ==> MIL Ops: 0%| | 0/970 [00:00<?, ? ops/s]Converting op 221 : constant
Adding op '221' of type const
Converting op 222 : constant
Adding op '222' of type const
Converting op 223 : constant
Adding op '223' of type const
Converting op 224 : constant
Adding op '224' of type const
Converting op 225 : constant
Converting op 226 : constant
Adding op '226' of type const
Converting op 227 : constant
Adding op '227' of type const
Converting op 228 : slice
Adding op '228' of type slice_by_index
Adding op '228_begin_0' of type const
Adding op '228_end_0' of type const
Adding op '228_stride_0' of type const
Adding op '228_end_mask_0' of type const
Converting op 229 : slice
Adding op '229' of type slice_by_index
Adding op '229_begin_0' of type const
Adding op '229_end_0' of type const
Adding op '229_stride_0' of type const
Adding op '229_end_mask_0' of type const
Converting op 230 : slice
Adding op '230' of type slice_by_index
Adding op '230_begin_0' of type const
Adding op '230_end_0' of type const
Adding op '230_stride_0' of type const
Adding op '230_end_mask_0' of type const
Converting op 231 : slice
Adding op '231' of type slice_by_index
Adding op '231_begin_0' of type const
Adding op '231_end_0' of type const
Adding op '231_stride_0' of type const
Adding op '231_end_mask_0' of type const
Converting op 232 : slice
Adding op '232' of type slice_by_index
Adding op '232_begin_0' of type const
Adding op '232_end_0' of type const
Adding op '232_stride_0' of type const
Adding op '232_end_mask_0' of type const
Converting op 233 : slice
Adding op '233' of type slice_by_index
Adding op '233_begin_0' of type const
Adding op '233_end_0' of type const
Adding op '233_stride_0' of type const
Adding op '233_end_mask_0' of type const
Converting op 234 : slice
Adding op '234' of type slice_by_index
Adding op '234_begin_0' of type const
Adding op '234_end_0' of type const
Adding op '234_stride_0' of type const
Adding op '234_end_mask_0' of type const
Converting op 235 : slice
Adding op '235' of type slice_by_index
Adding op '235_begin_0' of type const
Adding op '235_end_0' of type const
Adding op '235_stride_0' of type const
Adding op '235_end_mask_0' of type const
Converting op 236 : listconstruct
Converting op input.1 : cat
Adding op 'input.1' of type concat
Adding op 'input.1_interleave_0' of type const
Converting op 238 : listconstruct
Adding op '238' of type const
Converting op 239 : listconstruct
Adding op '239' of type const
Converting op 240 : listconstruct
Adding op '240' of type const
Converting op 241 : listconstruct
Adding op '241' of type const
Converting op x.2 : _convolution
Converting Frontend ==> MIL Ops: 2%|█ | 21/970 [00:00<00:00, 1017.80 ops/s]
CoreML export failure: unexpected number of inputs for node x.2 (_convolution): 13

Export complete (11.10s). Visualize with https://github.com/lutzroeder/netron

when I use command: python models/export.py --weights "yolov5l.pt" --img 640 --batch 1
I see #1667
my torch = 1.7.1 and torchvision= 0.8.2 torchaudio=0.7.2 coremltools=4.0

what wrong happen?

@Nabyssache Nabyssache added the bug Something isn't working label Jan 15, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2021

👋 Hello @Nabyssache, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@Nabyssache
Copy link
Author

Package Version


absl-py 0.11.0
attr 0.3.1
attrs 20.3.0
cachetools 4.2.0
certifi 2020.12.5
chardet 4.0.0
coremltools 4.0
cycler 0.10.0
Cython 0.29.21
google-auth 1.24.0
google-auth-oauthlib 0.4.2
grpcio 1.34.1
idna 2.10
joblib 1.0.0
kiwisolver 1.3.1
Markdown 3.3.3
matplotlib 3.3.3
mpmath 1.1.0
numpy 1.19.5
oauthlib 3.1.0
onnx 1.8.0
opencv-python 4.5.1.48
packaging 20.8
pandas 1.2.0
Pillow 8.1.0
pip 20.3.3
protobuf 3.14.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycocotools 2.0.2
pyparsing 2.4.7
python-dateutil 2.8.1
pytz 2020.5
PyYAML 5.3.1
requests 2.25.1
requests-oauthlib 1.3.0
rsa 4.7
scikit-learn 0.24.0
scipy 1.6.0
seaborn 0.11.1
setuptools 51.1.2.post20210112
six 1.15.0
sympy 1.7.1
tensorboard 2.4.1
tensorboard-plugin-wit 1.7.0
thop 0.0.31.post2005241907
threadpoolctl 2.1.0
torch 1.7.1
torchaudio 0.7.2
torchvision 0.8.2
tqdm 4.56.0
typing-extensions 3.7.4.3
urllib3 1.26.2
Werkzeug 1.0.1
wheel 0.36.2

@glenn-jocher
Copy link
Member

@Nabyssache coremltools is incompatible with recent versions of PyTorch. You should raise your issue directly on the coremltools repository.

@mzkaramat
Copy link

mzkaramat commented Feb 4, 2021

Head branch from coremltool repo which is compatible with PyTorch 1.7

pip install -Uqq git+https://github.com/apple/coremltools.git@master

@glenn-jocher
Copy link
Member

@mzkaramat thanks for the notice! That's good to know. We don't integrate master branch branches in requirements.txt (for stability), so I will wait for a release and then update requirements.txt on the next one. If anyone is working on CoreML export though I would recommend installing as @mzkaramat recommends for the time being.

@ramondebruyn
Copy link

@mzkaramat Thank you! I've been looking for a solution to this for a week and finally came across this!

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

4 participants