robot-surgery-segmentation
robot-surgery-segmentation copied to clipboard
No module named 'albumentations.torch.functional'
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.
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".
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
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.