Code Monkey home page Code Monkey logo

run-yolov8-in-one-line-on-jetson's People

Contributors

yuyoujiang avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

run-yolov8-in-one-line-on-jetson's Issues

One line command fails

Hello,

When running the python Run-YOLOv8-in-One-Line-on-Jetson/run.py command, it reinstalled torch and torchvision, but later in the running of the script an error mentions that the torch and torchvision versions are incompatible.

I find it strange as both versions were just installed by the same script.

Here is the full log trace:

$ python Run-YOLOv8-in-One-Line-on-Jetson/run.py
Step 1. Access the terminal of Jetson device, install pip and upgrade it
Upgrade pip...
nvidia-jetpack is already installed!
Step 2. Install Ultralytics package
WARNING: There was an error checking the latest version of pip.
Ultralytics has been installed
Step 3. Reinstall Torch and Torchvision
Get JetPack version...
JetPack: R35.2.1
Check torch ...
WARNING: There was an error checking the latest version of pip.
Installing dependency packages for torch...
debconf: delaying package configuration, since apt-utils is not installed
Done!
Downloading torch package...
--2023-10-16 12:18:13--  https://nvidia.box.com/shared/static/i8pukc49h3lhak4kkn67tg9j4goqm0m7.whl
Resolving nvidia.box.com (nvidia.box.com)... 74.112.186.144
Connecting to nvidia.box.com (nvidia.box.com)|74.112.186.144|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: /public/static/i8pukc49h3lhak4kkn67tg9j4goqm0m7.whl [following]
--2023-10-16 12:18:14--  https://nvidia.box.com/public/static/i8pukc49h3lhak4kkn67tg9j4goqm0m7.whl
Reusing existing connection to nvidia.box.com:443.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://nvidia.app.box.com/public/static/i8pukc49h3lhak4kkn67tg9j4goqm0m7.whl [following]
--2023-10-16 12:18:14--  https://nvidia.app.box.com/public/static/i8pukc49h3lhak4kkn67tg9j4goqm0m7.whl
Resolving nvidia.app.box.com (nvidia.app.box.com)... 74.112.186.144
Connecting to nvidia.app.box.com (nvidia.app.box.com)|74.112.186.144|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://public.boxcloud.com/d/1/b1!d_lBgWUOT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0rOBVZWSzdR-wmne0A5OarA_VxuliA16Ou67RuIch5kik2-F7-a2uBkZSO2HcCOowV5BHI_Py3UiqLaNj-THQqCC858qVCk1OPWblD3M_qRbyeDjXDFYHqOs0p-lbERd0wJ33jj-wwi_Cu-oU3U-T4Xj--Tf9REtkkJ56z24Poh39PBJqpJs2CNQ5CSRJ19h_t0qwbf60qlX70zdIL2JwIqWiBXcDQx90a77NQ51qzL18UU6qsJ7TH3MSFPQqbc6b1dDFix90-K_7Q5CxGQipqY7OINpyRpW7krSEwPSOZsvjOtaP7YhzPcuj87ZRvxDjch2ftc6jZvXCrHFBrmlZb1kybwhTi1xoIcN_Iu6IE-ilVnTjtSyroPMTbp_iMEDJV2r4_mE0i1yK6ML_wGcWT8xc4UzLepHY-ax308-SHy9qEn_yTNKuFr2jKlL0oSkEHgYVPKqXH7of0bh3FSfwLUU5BRhzfwPJiFfjPciEBr87vKbHse4v63BFYYIwad0CagzlZk7DIAl5YMIcLk6RcNJHSSoiRMOOa6KMm3aO7nGARNL4Las9xdsf-jBIBbUsh9CTX0driP7yqTOph-qgZCFFtJg2tEQ9hrVuuf-o9IN6GhKhcsq8nMR_s7hcZ9a0Qw9EJabZ75hRvf34zDruYoclxCQEeGxLk69UKAgnxTfJRt98nMvzVySnkadPDF2tCO1RhmH618bRIDztJ8_kMwjQOgq9s9emSRAuCMO-Odrzpoe-9-nWgAeIJ1Wcm_KAgVEzSS8kw-gWE8A../download
Resolving public.boxcloud.com (public.boxcloud.com)... 74.112.186.128
Connecting to public.boxcloud.com (public.boxcloud.com)|74.112.186.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 171764989 (164M) [application/octet-stream]
Saving to: ‘/home/jetson/git/Run-YOLOv8-in-One-Line-on-Jetson/cache/torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl’

/home/jetson/git/Run-YOLOv8-in- 100%[=====================================================>] 163.81M  12.1MB/s    in 13s

2023-10-16 12:18:29 (12.1 MB/s) - ‘/home/jetson/git/Run-YOLOv8-in-One-Line-on-Jetson/cache/torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl’ saved [171764989/171764989]

Installing torch...
Downloading torchvision...
Cloning into '/home/jetson/git/Run-YOLOv8-in-One-Line-on-Jetson/cache/torchvision'...
remote: Enumerating objects: 413885, done.
remote: Counting objects: 100% (22700/22700), done.
remote: Compressing objects: 100% (1749/1749), done.
remote: Total 413885 (delta 21948), reused 21240 (delta 20941), pack-reused 391185
Receiving objects: 100% (413885/413885), 796.19 MiB | 6.73 MiB/s, done.
Resolving deltas: 100% (384510/384510), done.
Installing torchvision...(about 10 minutes to wait)
Reinstall of torch torchvision completed!
Running environment configuration completed!
Downloading model...
--2023-10-16 12:36:02--  https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/521807533/1013abe2-be6e-4606-8433-daf2baecf594?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231016%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231016T103602Z&X-Amz-Expires=300&X-Amz-Signature=e7a4a2b3274b23ee1e6125ee312ddbb204544b2c6b7c99841d2e3dd4bc47132b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=521807533&response-content-disposition=attachment%3B%20filename%3Dyolov8n.pt&response-content-type=application%2Foctet-stream [following]
--2023-10-16 12:36:02--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/521807533/1013abe2-be6e-4606-8433-daf2baecf594?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231016%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231016T103602Z&X-Amz-Expires=300&X-Amz-Signature=e7a4a2b3274b23ee1e6125ee312ddbb204544b2c6b7c99841d2e3dd4bc47132b&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=521807533&response-content-disposition=attachment%3B%20filename%3Dyolov8n.pt&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6534387 (6.2M) [application/octet-stream]
Saving to: ‘/home/jetson/git/Run-YOLOv8-in-One-Line-on-Jetson/weights/detect/yolov8n.pt’

/home/jetson/git/Run-YOLOv8-in- 100%[=====================================================>]   6.23M  27.1MB/s    in 0.2s

2023-10-16 12:36:02 (27.1 MB/s) - ‘/home/jetson/git/Run-YOLOv8-in-One-Line-on-Jetson/weights/detect/yolov8n.pt’ saved [6534387/6534387]

/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/image.so: undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
  warn(
Ultralytics YOLOv8.0.185 🚀 Python-3.8.10 torch-1.14.0a0+44dac51c.nv23.01 CUDA:0 (Orin, 30589MiB)
YOLOv8n summary (fused): 168 layers, 3151904 parameters, 0 gradients, 8.7 GFLOPs

Downloading https://files.seeedstudio.com/products/NVIDIA-Jetson/people.mp4 to 'people.mp4'...
100%|████████████████████████████████████████████████████████████████████████████████████| 59.9M/59.9M [00:03<00:00, 20.0MB/s]
Traceback (most recent call last):
  File "/home/jetson/.local/bin/yolo", line 8, in <module>
    sys.exit(entrypoint())
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/cfg/__init__.py", line 445, in entrypoint
    getattr(model, mode)(**overrides)  # default args from model
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/engine/model.py", line 236, in predict
    return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream)
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 199, in predict_cli
    for _ in gen:  # running CLI inference without accumulating any outputs (do not modify)
  File "/home/jetson/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 50, in generator_context
    response = gen.send(None)
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 257, in stream_inference
    self.results = self.postprocess(preds, im, im0s)
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/models/yolo/detect/predict.py", line 25, in postprocess
    preds = ops.non_max_suppression(preds,
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/utils/ops.py", line 242, in non_max_suppression
    i = torchvision.ops.nms(boxes, scores, iou_thres)  # NMS
  File "/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/ops/boxes.py", line 40, in nms
    _assert_has_ops()
  File "/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/extension.py", line 48, in _assert_has_ops
    raise RuntimeError(
RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.__version__ and your torchvision version with torchvision.__version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

Would you have any idea how to fix this and move forward ?

My Jetson Orin device information:
NVIDIA Jetson AGX Orin
L4T 35.2.1 [ JetPack 5.1 ]
Ubuntu 20.04.6 LTS
Kernel Version: 5.10.104-tegra
CUDA 11.4.315
CUDA Architecture: 8.7
OpenCV version: 4.5.4
OpenCV Cuda: YES
CUDNN: 8.6.0.166
TensorRT: 8.5.2.2
Vision Works: NOT_INSTALLED
VPI: 2.2.4
Vulcan: 1.3.204

Thank you very much n advance for your help

EDIT:
This is the trace when running the command a second time and when torch and torchvision are recognised as "legal":

$ python Run-YOLOv8-in-One-Line-on-Jetson/run.py
Step 1. Access the terminal of Jetson device, install pip and upgrade it
Upgrade pip...
WARNING: There was an error checking the latest version of pip.
nvidia-jetpack is already installed!
Step 2. Install Ultralytics package
WARNING: There was an error checking the latest version of pip.
Ultralytics has been installed
Step 3. Reinstall Torch and Torchvision
Get JetPack version...
JetPack: R35.2.1
Check torch ...
WARNING: There was an error checking the latest version of pip.
The torch version is legal
Check torchvision ...
WARNING: There was an error checking the latest version of pip.
The torchvision version is legal
Running environment configuration completed!
/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/image.so: undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl'If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?
  warn(
Ultralytics YOLOv8.0.185 🚀 Python-3.8.10 torch-1.14.0a0+44dac51c.nv23.01 CUDA:0 (Orin, 30589MiB)
YOLOv8n summary (fused): 168 layers, 3151904 parameters, 0 gradients, 8.7 GFLOPs

Found https://files.seeedstudio.com/products/NVIDIA-Jetson/people.mp4 locally at people.mp4
Traceback (most recent call last):
  File "/home/jetson/.local/bin/yolo", line 8, in <module>
    sys.exit(entrypoint())
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/cfg/__init__.py", line 445, in entrypoint
    getattr(model, mode)(**overrides)  # default args from model
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/engine/model.py", line 236, in predict
    return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream)
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 199, in predict_cli
    for _ in gen:  # running CLI inference without accumulating any outputs (do not modify)
  File "/home/jetson/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 50, in generator_context
    response = gen.send(None)
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 257, in stream_inference
    self.results = self.postprocess(preds, im, im0s)
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/models/yolo/detect/predict.py", line 25, in postprocess
    preds = ops.non_max_suppression(preds,
  File "/home/jetson/.local/lib/python3.8/site-packages/ultralytics/utils/ops.py", line 242, in non_max_suppression
    i = torchvision.ops.nms(boxes, scores, iou_thres)  # NMS
  File "/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/ops/boxes.py", line 40, in nms
    _assert_has_ops()
  File "/home/jetson/.local/lib/python3.8/site-packages/torchvision-0.15.2a0+fa99a53-py3.8-linux-aarch64.egg/torchvision/extension.py", line 48, in _assert_has_ops
    raise RuntimeError(
RuntimeError: Couldn't load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.__version__ and your torchvision version with torchvision.__version__ and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.