LeeJunHyun / Image_Segmentation

Pytorch implementation of U-Net, R2U-Net, Attention U-Net, and Attention R2U-Net.
2.66k stars 594 forks source link

TypeError: function takes exactly 1 argument (3 given) #53

Closed WuGe0424 closed 1 year ago

WuGe0424 commented 4 years ago

Hello,I met some difficulties in this program. The main error is as follows : """ File "F:\Image_Segmentation-master\data_loader.py", line 57, in getitem GT = Transform(GT) File "D:\ProgramData\Anaconda3\envs\torch\lib\site-packages\torchvision\transforms\transforms.py", line 70, in call img = t(img) File "D:\ProgramData\Anaconda3\envs\torch\lib\site-packages\torchvision\transforms\transforms.py", line 1003, in call return F.rotate(img, angle, self.resample, self.expand, self.center, self.fill) File "D:\ProgramData\Anaconda3\envs\torch\lib\site-packages\torchvision\transforms\functional.py", line 729, in rotate return img.rotate(angle, resample, expand, center, fillcolor=fill) File "D:\ProgramData\Anaconda3\envs\torch\lib\site-packages\PIL\Image.py", line 2023, in rotate return self.transform((w, h), AFFINE, matrix, resample, fillcolor=fillcolor) File "D:\ProgramData\Anaconda3\envs\torch\lib\site-packages\PIL\Image.py", line 2337, in transform im = new(self.mode, size, fillcolor) File "D:\ProgramData\Anaconda3\envs\torch\lib\site-packages\PIL\Image.py", line 2544, in new return im._new(core.fill(mode, size, color)) TypeError: function takes exactly 1 argument (3 given) """

Can you help me solve that?

Aliang-CN commented 4 years ago

Solved by downgrading torch from 1.4.0 to 1.3.1, torchvision from 0.5.0 to 0.4.2, pillow from 7.0.0 to 6.2.1.