Code Monkey home page Code Monkey logo

Comments (7)

dsbyprateekg avatar dsbyprateekg commented on May 26, 2024 1

It will automatically pick up the GPU if found.

from yolov7.

krambriw avatar krambriw commented on May 26, 2024

I have now managed to get the YOLOv7 project running on my NVIDIA Jetson Nano. But when I run detect.py it seems it is not using the GPU. I added a print statement as below and it reports 'cpu'. Setting the option --device to 0 does not work. Any hints how to enable the script to use the GPU instead is highly appreciated

With kind regards, Walter

# Run inference
print (device.type)
if device.type != 'cpu':
    model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters())))  # run once
old_img_w = old_img_h = imgsz
old_img_b = 1

from yolov7.

dsbyprateekg avatar dsbyprateekg commented on May 26, 2024

I have now managed to get the YOLOv7 project running on my NVIDIA Jetson Nano. But when I run detect.py it seems it is not using the GPU. I added a print statement as below and it reports 'cpu'. Setting the option --device to 0 does not work. Any hints how to enable the script to use the GPU instead is highly appreciated

With kind regards, Walter

# Run inference
print (device.type)
if device.type != 'cpu':
    model(torch.zeros(1, 3, imgsz, imgsz).to(device).type_as(next(model.parameters())))  # run once
old_img_w = old_img_h = imgsz
old_img_b = 1

Have you checked if your device has cuda successfully installed or not?
Please check with nvidia-smi command.

from yolov7.

krambriw avatar krambriw commented on May 26, 2024

Thanks, I guess I have not. I just flashed a SD card with the NVIDIA provided image, guess CUDA is not part of that. I will try to install CUDA Toolkit

from yolov7.

krambriw avatar krambriw commented on May 26, 2024

Hello, thanks for your help!

I have now installed CUDA following this guide:
https://jfrog.com/connect/post/installing-cuda-on-nvidia-jetson-nano/

Verifying...looks ok as below, but still, only cpu is used by the detect.py
YOLOR 🚀 v0.1-128-ga207844 torch 1.13.1 CPU

Trying to set device to 0 gets
AssertionError: CUDA unavailable, invalid device cuda requested

Any more hints really grateful. This is a difficult subject
Kind regards, Walter

walter@walter-jetson-227:/$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Thu_Jun_11_22:26:42_PDT_2020
Cuda compilation tools, release 11.0, V11.0.194
Build cuda_11.0_bu.TC445_37.28540450_0

walter@walter-jetson-227:/$ dpkg -l | grep cuda
iU cuda 11.0.2-1 arm64 CUDA meta-package
iU cuda-11-0 11.0.2-1 arm64 CUDA 11.0 meta-package
ii cuda-command-line-tools-10-2 10.2.460-1 arm64 CUDA command-line tools
iU cuda-command-line-tools-11-0 11.0.2-1 arm64 CUDA command-line tools
ii cuda-compiler-10-2 10.2.460-1 arm64 CUDA compiler

etc

from yolov7.

dsbyprateekg avatar dsbyprateekg commented on May 26, 2024

Looks like cuda 11.0 support issue with Jetson Nano. You need to try with Cuda 10.2.
Please uninstall everything and follow this video to install OpenCV with Cuda enabled-
https://www.youtube.com/watch?v=P-EZr0zy53g&t=30s
After successfully doing the above setup, follow the video-
https://www.youtube.com/watch?v=ZXbOV83EXdQ&t=1443s

Please make sure you use the exact version of the libraries that the video has mentioned.

from yolov7.

krambriw avatar krambriw commented on May 26, 2024

Thanks for your kind help, I will redo things, eventually come back and re-open the issue
Best regards, Walter

from yolov7.

Related Issues (20)

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.