Fastai2.medical.imaging not working

Hi,

Since two days fastai2.medical.imaging isn’t working for me anymore on Colab. The problems seems to be that the kornia package downgrades torch to 1.5.0, while torchvision 0.6.1 has the requirement of torch 1.5.1.

And after restarting the runtime I get the following error when trying to import the fastai packages:

RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=10.2 and torchvision has CUDA Version=10.1. Please reinstall the torchvision that matches your PyTorch install.

Does anyone know a work around for this?

1 Like

The issue is with kornia.

use pip kornia===0.2.0 and it should work. You can also check out my medical imaging blog for more info on using fastai for medical imaging and here is a link to the colab page

1 Like

Thanks, that worked!

1 Like

Hello I have installed fastai and I can’t import from fastai2.medical.imaging import * what can be issue I also installed kornia.

>>> import fastai
>>> fastai.__version__
'2.4.1'
>>> 

here is my system output please help
When I import the above medical module it says

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-15-5d79546b95ef> in <module>
----> 1 from fastai2.medical.imaging import *

~/anaconda3/envs/chest-weak/lib/python3.6/site-packages/fastai2/medical/imaging.py in <module>
      7 #Cell
      8 from ..test import *
----> 9 from ..basics import *
     10 from ..vision.all import *
     11 

~/anaconda3/envs/chest-weak/lib/python3.6/site-packages/fastai2/basics.py in <module>
----> 1 from .data.all import *
      2 from .optimizer import *
      3 from .learner import *
      4 from .metrics import *
      5 from .interpret import *

ModuleNotFoundError: No module named 'fastai2.data'

You should use: from fastai.medical.imaging import *
not fastai2.

Thanks its works

1 Like