FastSAM icon indicating copy to clipboard operation
FastSAM copied to clipboard

No module named 'ultralytics.yolo'

Open bminevich opened this issue 2 years ago • 3 comments

I followed the steps listed. I saved the repository locally, made a new python environment locally (3.9), then I ran the requirements.txt file, uninstalled torch and torchvision and installed the cuda versions, and then I ran the setup.py file.

But I am getting this error:

ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 8 5 import cv2 6 import tifffile as tf ----> 8 from fastsam import FastSAM, FastSAMPrompt 9 import torch 10 import glob

File ~/.conda/envs/image_analysis/lib/python3.9/site-packages/fastsam/init.py:3 1 # Ultralytics YOLO 🚀, AGPL-3.0 license ----> 3 from .model import FastSAM 4 from .predict import FastSAMPredictor 5 from .prompt import FastSAMPrompt

File ~/.conda/envs/image_analysis/lib/python3.9/site-packages/fastsam/model.py:12 1 # Ultralytics YOLO 🚀, AGPL-3.0 license 2 """ 3 FastSAM model interface. 4 (...) 9 results = model.predict('ultralytics/assets/bus.jpg') 10 """ ---> 12 from ultralytics.yolo.cfg import get_cfg 13 from ultralytics.yolo.engine.exporter import Exporter 14 from ultralytics.yolo.engine.model import YOLO

ModuleNotFoundError: No module named 'ultralytics.yolo'

How do I resolve this issue?

bminevich avatar Nov 04 '24 21:11 bminevich

I suggest you run it through the syntaxes given in the README file, as the setup.py file has not been updated for a year. Therefore, there is a high chance it will throw errors.

jaidh01 avatar Dec 03 '24 15:12 jaidh01

same problem, have you solved this?

zzzfoxz avatar Jun 24 '25 05:06 zzzfoxz

same problem here, anyone have solved this?

hongsamvo avatar Sep 30 '25 08:09 hongsamvo