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

importlib.metadata.PackageNotFoundError: torchvision #2

Open
AmandaYapMY opened this issue Oct 29, 2024 · 0 comments
Open

importlib.metadata.PackageNotFoundError: torchvision #2

AmandaYapMY opened this issue Oct 29, 2024 · 0 comments

Comments

@AmandaYapMY
Copy link

Hello! I ran wget files.seeedstudio.com/YOLOv8-Jetson.py && python YOLOv8-Jetson.py
and i got
--2024-10-29 13:34:58-- http://files.seeedstudio.com/YOLOv8-Jetson.py
Resolving files.seeedstudio.com (files.seeedstudio.com)... 13.33.88.36, 13.33.88.99, 13.33.88.34, ...
Connecting to files.seeedstudio.com (files.seeedstudio.com)|13.33.88.36|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://files.seeedstudio.com/YOLOv8-Jetson.py [following]
--2024-10-29 13:34:58-- https://files.seeedstudio.com/YOLOv8-Jetson.py
Connecting to files.seeedstudio.com (files.seeedstudio.com)|13.33.88.36|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12198 (12K) [application/octet-stream]
Saving to: ‘YOLOv8-Jetson.py.1’

YOLOv8-Jetson.py.1 100%[====================>] 11,91K --.-KB/s in 0s

2024-10-29 13:34:59 (92,8 MB/s) - ‘YOLOv8-Jetson.py.1’ saved [12198/12198]

Step 1. Access the terminal of Jetson device, install pip and upgrade it
Upgrade pip...
E: The repository 'http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu focal Release' does not have a Release file.
E: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu focal Release' does not have a Release file.
nvidia-jetpack is already installed!
Step 2. Install Ultralytics package
Ultralytics has been installed
Step 3. Reinstall Torch and Torchvision
Get JetPack version...
JetPack: R35.1.0
Check torch ...
Installing dependency packages for torch...
Done!
Installing torch...
Downloading torchvision...
Cloning into '/mnt/ssd1/home/brushlessdc/cache/torchvision'...
remote: Enumerating objects: 584084, done.
remote: Counting objects: 100% (31870/31870), done.
remote: Compressing objects: 100% (1835/1835), done.
remote: Total 584084 (delta 29888), reused 31754 (delta 29810), pack-reused 552214 (from 1)
Receiving objects: 100% (584084/584084), 1.09 GiB | 10.88 MiB/s, done.
Resolving deltas: 100% (545979/545979), done.
Installing torchvision...(about 10 minutes to wait)
Reinstall of torch torchvision completed!
Running environment configuration completed!
Downloading model...
--2024-10-29 13:41:05-- https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/521807533/732c503e-9fcb-4a82-be7f-106baafbda15?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241029%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241029T054146Z&X-Amz-Expires=300&X-Amz-Signature=2b0e1cf82cb9b6014de8db00264c35120729dabd6ec276e981a55c1c32966c8a&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dyolov8n.pt&response-content-type=application%2Foctet-stream [following]
--2024-10-29 13:41:05-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/521807533/732c503e-9fcb-4a82-be7f-106baafbda15?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241029%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241029T054146Z&X-Amz-Expires=300&X-Amz-Signature=2b0e1cf82cb9b6014de8db00264c35120729dabd6ec276e981a55c1c32966c8a&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dyolov8n.pt&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6534387 (6,2M) [application/octet-stream]
Saving to: ‘/mnt/ssd1/home/brushlessdc/weights/detect/yolov8n.pt’

/mnt/ssd1/home/brush 100%[====================>] 6,23M 11,1MB/s in 0,6s

2024-10-29 13:41:06 (11,1 MB/s) - ‘/mnt/ssd1/home/brushlessdc/weights/detect/yolov8n.pt’ saved [6534387/6534387]

Traceback (most recent call last):
File "/mnt/ssd1/home/brushlessdc/anaconda3/bin/yolo", line 5, in
from ultralytics.cfg import entrypoint
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/init.py", line 11, in
from ultralytics.models import NAS, RTDETR, SAM, YOLO, FastSAM, YOLOWorld
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/models/init.py", line 3, in
from .fastsam import FastSAM
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/models/fastsam/init.py", line 3, in
from .model import FastSAM
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/models/fastsam/model.py", line 5, in
from ultralytics.engine.model import Model
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/engine/model.py", line 11, in
from ultralytics.cfg import TASK2DATA, get_cfg, get_save_dir
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/cfg/init.py", line 11, in
from ultralytics.utils import (
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/site-packages/ultralytics/utils/init.py", line 50, in
TORCHVISION_VERSION = importlib.metadata.version("torchvision") # faster than importing torchvision
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/importlib/metadata.py", line 530, in version
return distribution(distribution_name).version
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/importlib/metadata.py", line 503, in distribution
return Distribution.from_name(distribution_name)
File "/mnt/ssd1/home/brushlessdc/anaconda3/lib/python3.8/importlib/metadata.py", line 177, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: torchvision

I ran python
import torch
import torchvision
ModuleNotFoundError: No module named 'torchvision"
torch.version
1.13.0a0+d0d6b1f2.nv22.10
torchvision.version
File "", line 1, in
NameError: name 'torchvision' is not defined

pip list | grep torch
torch 1.13.0a0+d0d6b1f2.nv22.10

How to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant