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

why change from python3.6 to python3.7? #7631

Closed
1 task done
fei4xu opened this issue Apr 29, 2022 · 8 comments · Fixed by #7645
Closed
1 task done

why change from python3.6 to python3.7? #7631

fei4xu opened this issue Apr 29, 2022 · 8 comments · Fixed by #7645
Labels
question Further information is requested

Comments

@fei4xu
Copy link

fei4xu commented Apr 29, 2022

Search before asking

Question

Hi,

I have a Jetson Nano with has python 3.6 and its pytorch version for python3.6.

I checked the readme.md and found that the required python version was changed from 3.6 to 3.7 recently ( commit ff8646c 2022/1/26) and then released as v6.1 tag. I didn't see any python or library upgrade around those commits.

I'd like to check if this is a planned version upgrade or python3.6 is still supported.

Thanks,

Fei

Additional

No response

@fei4xu fei4xu added the question Further information is requested label Apr 29, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2022

👋 Hello @fei4xu, 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://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

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), validation (val.py), inference (detect.py) and export (export.py) on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

@fei4xu Python 3.6 has reached end of life and is no longer officially supported: https://endoflife.date/python

@fei4xu
Copy link
Author

fei4xu commented Apr 29, 2022

Thanks, so I can safely guess that there isn't a technical reason (like library dependency) to drop python 3.6 support.

Actually I just tried, on Jetson Nano (python 3.6.9), with the latest code on master branch, if I ignore this change (a19406b) and change opencv from 4.1.2 to 4.1.1 which comes default in Jetson, everything works just fine!

Python version itself and the dependent libraries' version are alwasy a headache for new users. I don't want to let new users like me spend lots of time upgrading python versions. so maybe we can still leave a note on the readme page that python3.6 still works but not recommanded?

Thanks again for the great work!

@glenn-jocher
Copy link
Member

@fei4xu we can try to revert cv2 dependency to 4.1.1, but we can no longer state support for 3.6 as we no longer test for it.

@glenn-jocher
Copy link
Member

@fei4xu good news 😃! Your original issue may now be fixed ✅ in PR #7645. This PR drops cv2 requirements to >=4.1.1. I think the second change that would be needed for native Jetson support would be to do a soft test of python version (display a warning) rather than a hard test.

To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

@glenn-jocher
Copy link
Member

glenn-jocher commented Apr 29, 2022

@fei4xu unofficial 3.6.9 support seems to work across most operating systems (macos and ubuntu). See https://github.com/ultralytics/yolov5/runs/6234184629?check_suite_focus=true

@StephenBeirlaen
Copy link

Hi all, sorry for reviving this, but it might help the OP.
I can confirm that Yolov5 is now running with this PR on my Jetson Nano 2GB. Thanks! :)
I used this image to have all system dependencies installed for me. I also had to run a pip3 install --upgrade pip before I could install Yolov5 requirements.

Question though: I had to add a swapfile to make inference run because Yolov5 consumes a lot of memory (1.9/2 GB RAM and 2.1 GB of swap). Are these numbers normal for Yolov5? I am only interested in running inference on this device, no training. Anything I can tune to fit in 2GB RAM? Already switched to lightdm which saves me ~500 MB.
Thanks in advance!

image

@glenn-jocher
Copy link
Member

glenn-jocher commented May 3, 2022

@StephenBeirlaen great, thanks for the confirmation! Most of our focus has been on efficient resource utilization during training, i.e. reducing CUDA memory requirements, and not especially on edge device inference, so I can't provide you specifics there.

But that said, torch is primarily a training framework and you can definitely realize performance gains by exporting to TRT for CUDA deployments, i.e.:

Format export.py --include Model
PyTorch - yolov5s.pt
TorchScript torchscript yolov5s.torchscript
ONNX onnx yolov5s.onnx
OpenVINO openvino yolov5s_openvino_model/
TensorRT engine yolov5s.engine
CoreML coreml yolov5s.mlmodel
TensorFlow SavedModel saved_model yolov5s_saved_model/
TensorFlow GraphDef pb yolov5s.pb
TensorFlow Lite tflite yolov5s.tflite
TensorFlow Edge TPU edgetpu yolov5s_edgetpu.tflite
TensorFlow.js tfjs yolov5s_web_model/

Usage:

git clone https://github.com/ultralytics/yolov5 -b update/bench_gpu  # clone
cd yolov5
pip install -qr requirements.txt coremltools onnx onnxruntime-gpu openvino-dev  # install
pip install -U nvidia-tensorrt --index-url https://pypi.ngc.nvidia.com  # TensorRT

python utils/benchmarks.py --weights yolov5s.pt --img 640 --device 0

Colab Pro+ V100 High-RAM Results

benchmarks: weights=/content/yolov5/yolov5s.pt, imgsz=640, batch_size=1, data=/content/yolov5/data/coco128.yaml, device=0, half=False, test=False
Checking setup...
YOLOv5 🚀 v6.1-135-g7926afc torch 1.10.0+cu111 CUDA:0 (Tesla V100-SXM2-16GB, 16160MiB)
Setup complete ✅ (8 CPUs, 51.0 GB RAM, 46.7/166.8 GB disk)

Benchmarks complete (458.07s)
                   Format  mAP@0.5:0.95  Inference time (ms)
0                 PyTorch        0.4623                10.19
1             TorchScript        0.4623                 6.85
2                    ONNX        0.4623                14.63
3                OpenVINO           NaN                  NaN
4                TensorRT        0.4617                 1.89
5                  CoreML           NaN                  NaN
6   TensorFlow SavedModel        0.4623                21.28
7     TensorFlow GraphDef        0.4623                21.22
8         TensorFlow Lite           NaN                  NaN
9     TensorFlow Edge TPU           NaN                  NaN
10          TensorFlow.js           NaN                  NaN

tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this issue Jun 10, 2022
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this issue Aug 26, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this issue Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants