ModuleNotFoundError: No module named 'sahi.model'

See original GitHub issue

🐛 Bug

I just want to run tutorial here.

Environment

  • Ubuntu Desktop 22.04 LTS
  • GPU RTX2080
  • Driver nvidia-driver-510

To Reproduce

  • Dockerfile
FROM nvidia/cuda:11.6.0-cudnn8-devel-ubuntu20.04

# https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes
ENV TZ=Asia/Tokyo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get install -y python3 python3-pip \
&& apt-get install ffmpeg libsm6 libxext6  -y

RUN pip3 install --no-cache-dir \
   jupyterlab \
   lightning-flash[image] \
   icedata \
   icevision
  • docker-compose.yaml
version: "3"
services:
  notebook:
    build: .
    volumes:
      - ".:/home/work"
      - ".jupyter:/root/.jupyter"
    ports:
      - "7777:7777"
    tty: true
    environment:
      - JUPYTER_ENABLE_LAB=yes
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
    deploy:
       resources:
         reservations:
           devices:
             - capabilities:
               - gpu
    command: jupyter lab --ip=0.0.0.0 --port=7777 --allow-root --no-browser --NotebookApp.token=''

Then, run

docker compose up

Connect to localhost:7777 and open up jupyter.

Then, run

from functools import partial

import flash
from flash.core.utilities.imports import example_requires
# from flash.image import InstanceSegmentation, InstanceSegmentationData

example_requires("image")

import icedata  # noqa: E402

I got the error

ModuleNotFoundErrorTraceback (most recent call last) Cell In [3], line 9 5 # from flash.image import InstanceSegmentation, InstanceSegmentationData 7 example_requires(“image”) ----> 9 import icedata # noqa: E402

File /usr/local/lib/python3.8/dist-packages/icedata/init.py:1 ----> 1 import icedata.utils 2 import icedata.template 4 from icedata.utils import *

File /usr/local/lib/python3.8/dist-packages/icedata/utils/init.py:1 ----> 1 from icedata.utils.utils import * 2 from icedata.utils.plot_size_histogram import *

File /usr/local/lib/python3.8/dist-packages/icedata/utils/utils.py:3 1 all = [“load_model_weights_from_url”, “load_data”] ----> 3 from icevision.all import * 6 def load_model_weights_from_url( 7 model: nn.Module, url: str, map_location=torch.device(“cpu”), **kwargs 8 ) -> None: 9 state_dict = torch.hub.load_state_dict_from_url( 10 url, map_location=map_location, **kwargs 11 )

File /usr/local/lib/python3.8/dist-packages/icevision/init.py:7 5 from icevision.data import * 6 from icevision import backbones ----> 7 from icevision import models 8 from icevision.metrics import * 9 from icevision.visualize import *

File /usr/local/lib/python3.8/dist-packages/icevision/models/init.py:32 29 from icevision.models import fastai 31 if SoftDependencies.sahi: —> 32 from icevision.models import inference_sahi

File /usr/local/lib/python3.8/dist-packages/icevision/models/inference_sahi.py:14 10 from icevision.visualize.utils import * 11 from icevision.tfms.albumentations import albumentations_adapter —> 14 from sahi.model import DetectionModel 15 from sahi.prediction import ObjectPrediction 16 from sahi.predict import get_sliced_prediction as sahi_get_sliced_prediction

ModuleNotFoundError: No module named ‘sahi.model’

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
fcakyoncommented, Nov 13, 2022

OK @krshrimali, will let you know once icevision is updated and a new version is shipped 👍

2reactions
fcakyoncommented, Nov 13, 2022

I will try to get in contact with icevision devs, thanks for the response!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'Shahi'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'Shahi' How to remove the ModuleNotFou.
Read more >
PyTorch Hub ModuleNotFoundError: No module named 'utils ...
The ModuleNotFoundError: No module named 'utils.datasets'; 'utils' is not a package is a python error that sometimes occurs when python doesn't ...
Read more >
YOLO5 : ModuleNotFoundError: No module named 'utils ...
It just happened to me. It turns out I had a module named utils already installed. Checking where it is with utils.
Read more >
Solved: ModuleNotFoundError: No module named 'models'
Solved: By Running the # Object Detection Python\* Demo after moving complete folder from initial location.
Read more >
Webdemo Microalgae Counting - a Hugging Face Space by ...
Traceback (most recent call last): File "app.py", line 2, in <module> from ... import DetectionModel ModuleNotFoundError: No module named 'sahi.model'
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found