robot-surgery-segmentation icon indicating copy to clipboard operation
robot-surgery-segmentation copied to clipboard

No module named 'albumentations.torch.functional'

Open rknoopsLime opened this issue 5 years ago • 3 comments

in demo.ipynb, the line

from dataset import load_image

gives

ModuleNotFoundError: No module named 'albumentations.torch.functional'

I used conda to install albumentations, and the ipnyb command 'import albumentations.torch' loads properly. Apologies if this is an error from my side.

rknoopsLime avatar Jan 09 '19 11:01 rknoopsLime

in demo.ipynb, the line

from dataset import load_image

gives

ModuleNotFoundError: No module named 'albumentations.torch.functional'

I used conda to install albumentations, and the ipnyb command 'import albumentations.torch' loads properly. Apologies if this is an error from my side.

I solved it by "sudo pip3 install albumentations".

EmmaSRH avatar Jan 17 '19 13:01 EmmaSRH

Depends on the albementations version you have used. you may want to workaround by replacing from

from albumentations.torch.functional import img_to_tensor

to

from albumentations.pytorch.transforms import img_to_tensor

sakares avatar Mar 23 '19 03:03 sakares

The issue can arise because requirements.txt does not specify the version of albumentations to use:

https://github.com/ternaus/robot-surgery-segmentation/blob/de12469172239a32c0dfe7c39832ac5e52ee2baf/requirements.txt#L1-L4

Following your remark about version, I have run pip install --upgrade albumentations, and this has solved the issue.

woctezuma avatar Dec 11 '20 23:12 woctezuma