anyuexuan / CSS

Code for "Conditional Self-Supervised Learning for Few-Shot Classification" in IJCAI 2021.
Other
21 stars 3 forks source link

Some bug #1

Open zwy1996 opened 2 years ago

zwy1996 commented 2 years ago

Hi, nice job!

When I ran the code, I met the following error: x = transforms.RandomResizedCrop(self.image_size, interpolation=Image.BICUBIC)(img) File "/home/harry/anaconda2/envs/css/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 387, in call i, j, h, w = self.get_params(img, self.scale, self.ratio) File "/home/harry/anaconda2/envs/css/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 358, in get_params area = img.size[0] * img.size[1] TypeError: 'builtin_function_or_method' object is not subscriptable

It maybe because of the version of torchvision. Would you please offer the environment that you used? Specially torch and torchvision. I had tried torch=1.6, 0.4.1, it did not work!

Thank you very much!

anyuexuan commented 2 years ago

Maybe the version of torchvision is too old. You can update torchvision to the latest version and try again ☺