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

Error when loading icevision in colab #1160

Open
misza222 opened this issue Nov 24, 2022 · 2 comments
Open

Error when loading icevision in colab #1160

misza222 opened this issue Nov 24, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@misza222
Copy link

🐛 Bug

Hi there, when I import icevision in colab I get an error:
ModuleNotFoundError: No module named 'sahi.model'

To Reproduce
Steps to reproduce the behavior:
!pip install icevision[all]
from icevision.all import *

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-5-2dc2b878494d>](https://localhost:8080/#) in <module>
----> 1 from icevision.all import *

2 frames
[/usr/local/lib/python3.7/dist-packages/icevision/__init__.py](https://localhost:8080/#) in <module>
      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 *

[/usr/local/lib/python3.7/dist-packages/icevision/models/__init__.py](https://localhost:8080/#) in <module>
     30 
     31 if SoftDependencies.sahi:
---> 32     from icevision.models import inference_sahi

[/usr/local/lib/python3.7/dist-packages/icevision/models/inference_sahi.py](https://localhost:8080/#) in <module>
     12 
     13 
---> 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'

Screenshots

Screenshot 2022-11-24 at 15 06 49

Where it happens:

  • colab (possibly others, but I didn't have a chance to check)
@misza222 misza222 added the bug Something isn't working label Nov 24, 2022
@misza222
Copy link
Author

misza222 commented Nov 28, 2022

The problem is with sahi library - they have changed the interface between version 0.10 and 0.11 and icevision 0.12 (most recent version on pip) relies on things that are only present in <= sahi 0.10.*

@shravankumar147
Copy link

Hi,

I Encounter the same issue,

The Issue occurred when I tried to import --> from icevision.all import *

[/usr/local/lib/python3.8/dist-packages/icevision/models/inference_sahi.py](https://localhost:8080/#) in <module>

---> 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'

My Installation followed :

# # Torch - Torchvision - IceVision - IceData - MMDetection - YOLOv5 - EfficientDet Installation
!wget https://raw.githubusercontent.com/airctic/icevision/master/icevision_install.sh

# # Choose your installation target: cuda11 or cuda10 or cpu
!bash icevision_install.sh cuda11

then installed sahi

!pip install sahi -U
then I checked the versions of Icevision and sahi.

icedata 0.5.1
icevision 0.12.0
sahi 0.11.6

As the error is pointing to the icevision/models/inference_sahi.py file, I looked into it and modified as below:

from sahi import DetectionModel instead from sahi.model import DetectionModel

This solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants