Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import ToTensorV2 in Colab

from albumentations.pytorch.transforms import ToTensorV2

I used the above code, and it doesn't work.

like image 532
crypto-is-hard Avatar asked Jul 13 '20 08:07

crypto-is-hard


2 Answers

Just add a code block with the line

! pip install albumentations==0.4.6

above the block where you do the import. I tried installing it without the specific version and it failed.

When i did not specify the version number in pip install, version 0.1.12 was installed which does not contain ToTensorV2.

like image 188
Michamei Avatar answered Nov 14 '22 02:11

Michamei


Ensure that you have the latest version

!pip install --upgrade --force-reinstall --no-deps albumentations
like image 3
Alexandros Kouretsis Avatar answered Nov 14 '22 00:11

Alexandros Kouretsis