ultralytics / yolov5

YOLOv5 šŸš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.25k stars 16.22k forks source link

Process finished with exit code -1073741819 (0xC0000005) #5722

Closed jzod closed 2 years ago

jzod commented 2 years ago

Search before asking

YOLOv5 Component

PyTorch Hub

Bug

The following line of code: model = torch.hub.load('ultralytics/yolov5', 'yolov5s') Produces this error in PyCharm: Process finished with exit code -1073741819 (0xC0000005)

When I run from the command prompt it just exits with no code: cmd

Environment

Base ----------------------------------------

matplotlib>=3.2.2 numpy>=1.18.5 opencv-python>=4.1.2 Pillow>=7.1.2 PyYAML>=5.3.1 requests>=2.23.0 torch>=1.7.0 torchvision>=0.8.1 tqdm>=4.41.0

Logging -------------------------------------

wandb

Plotting ------------------------------------

pandas>=1.1.4 seaborn>=0.11.0

Export --------------------------------------

coremltools>=4.1 # CoreML export

onnx>=1.9.0 # ONNX export

onnx-simplifier>=0.3.6 # ONNX simplifier

scikit-learn==0.19.2 # CoreML quantization

tensorflow>=2.4.1 # TFLite export

tensorflowjs>=3.9.0 # TF.js export

Extras --------------------------------------

albumentations>=1.0.3

Cython # for pycocotools https://github.com/cocodataset/cocoapi/issues/172

pycocotools>=2.0 # COCO mAP

roboflow

thop~=0.0.31.post2005241907

pip~=21.3.1 wheel~=0.37.0 setuptools~=59.1.1 Flask~=2.0.2 val~=0.6-

Minimal Reproducible Example

Here is the code: code

Additional

I created a clean venv with Python 3.8.0 as it stated in the docs and I use PyCharm so I sync'd with the requirements.txt provided.

Are you willing to submit a PR?

glenn-jocher commented 2 years ago

@jzod šŸ‘‹ hi, thanks for letting us know about this possible problem with YOLOv5 šŸš€. I'm not able to reproduce any problems with your command in PyCharm on MacOS. In any case if this is reproducible with other torch hub repos then this may be a torch issue which should be raised at https://github.com/pytorch/pytorch

Screenshot 2021-11-20 at 12 35 29

We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem.

How to create a Minimal, Reproducible Example

When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:

For Ultralytics to provide assistance your code should also be:

If you believe your problem meets all the above criteria, please close this issue and raise a new one using the šŸ› Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.

Thank you! šŸ˜ƒ

github-actions[bot] commented 2 years ago

šŸ‘‹ Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 šŸš€ resources:

Access additional Ultralytics āš” resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 šŸš€ and Vision AI ā­!

jzod commented 2 years ago

I followed the same steps on another machine and it worked fine. Iā€™m looking for some clues on what is causing this only on one machine. What could cause this error? Iā€™m sure it not your code.

Joe

On Dec 20, 2021, at 7:13 PM, github-actions[bot] @.***> wrote:

ļ»æ šŸ‘‹ Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 šŸš€ resources:

Wiki ā€“ https://github.com/ultralytics/yolov5/wiki Tutorials ā€“ https://docs.ultralytics.com/yolov5 Docs ā€“ https://docs.ultralytics.com Access additional Ultralytics āš” resources:

Ultralytics HUB ā€“ https://ultralytics.com/hub Vision API ā€“ https://ultralytics.com/yolov5 About Us ā€“ https://ultralytics.com/about Join Our Team ā€“ https://ultralytics.com/work Contact Us ā€“ https://ultralytics.com/contact Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 šŸš€ and Vision AI ā­!

ā€” Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

github-actions[bot] commented 2 years ago

šŸ‘‹ Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 šŸš€ resources:

Access additional Ultralytics āš” resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 šŸš€ and Vision AI ā­!

jzod commented 2 years ago

I finally tracked down the problem to the version of Pillow I had in my venv. I had v9.0.1 and when I reverted to 7.1.2 it worked.

I would be interested in knowing why this worked.

glenn-jocher commented 2 years ago

@jzod see requirements: https://github.com/ultralytics/yolov5/blob/3eef80457febcc4934e06b6f9f3e6efc115c66fc/requirements.txt#L7

jzod commented 2 years ago

Glenn, the requirements say > or = 7.1.2, not = 7.1.2.

On Feb 12, 2022, at 6:58 AM, Glenn Jocher @.***> wrote:

ļ»æ @jzod see requirements: https://github.com/ultralytics/yolov5/blob/3eef80457febcc4934e06b6f9f3e6efc115c66fc/requirements.txt#L7

ā€” Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

glenn-jocher commented 2 years ago

@jzod ah got you, didn't read your message clearly. So you're saying there's a bug in current Pillow package? https://pypi.org/project/Pillow/

Should we exclude 9.0.1? i.e.:

Pillow>=7.1.2,<9.0.1
glenn-jocher commented 2 years ago

@jzod everything works correctly for me in Colab with Pillow==9.0.1. I'm unable to see any errors:

!git clone https://github.com/ultralytics/yolov5  # clone
%cd yolov5
%pip install Pillow==9.0.1
%pip install -qr requirements.txt  # install
glenn-jocher commented 2 years ago

@jzod Colab validation of Pillow==9.0.1 (restart runtime for install to take effect).

Screenshot 2022-02-12 at 14 24 47
jzod commented 2 years ago

Glenn,

Please see the test I ran. detect.py runs successfully with Pillow v7.1.2 and fails with v9.0.1. I only see the exit code -1073741819 when I run detect.py within PyCharm. At the command prompt it just returns with nothing. I have another machine and I have v9.0.1 installed with no issues. There is something weird about this machine. I'm going to make the two environments the same and see if this problem goes aways. It must be some interaction with another package. FYI: I started by installing requirements.txt in a new venv and that didn't work. [image: Yolov5 Pillow Test.png]

On Sat, Feb 12, 2022 at 8:26 AM Glenn Jocher @.***> wrote:

@jzod https://github.com/jzod Colab validation of Pillow==9.0.1 (restart runtime for install to take effect).

[image: Screenshot 2022-02-12 at 14 24 47] https://user-images.githubusercontent.com/26833433/153713232-6291c559-ed14-442d-8bc3-437d2b408106.png

ā€” Reply to this email directly, view it on GitHub https://github.com/ultralytics/yolov5/issues/5722#issuecomment-1037225570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHNDIHYUQ5PJRXGU6NJJ6MTU2ZNWTANCNFSM5IMOFUHA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

bladjiang commented 3 months ago

@jzod thks. it really works after i reinstalled pillow package!!! it's the pillow packege's problem.

pip uninstall pillow pip install pillow