agaldran / lwnet

State-of-the-art retinal vessel segmentation with minimalistic models
MIT License
73 stars 27 forks source link

'affine() got an unexpected argument 'resample'' #9

Closed reuben58male closed 3 months ago

reuben58male commented 3 months ago

Hi, I was trying to run the 'train_cyclical.py' in jupyterlab: %run train_cyclical.py --csv_train data/DRIVE/train.csv --cycle_lens 20/50 --model_name wnet --save_path wnet_drive --device cpu

Then I got an error as below. Thank you.

TypeError Traceback (most recent call last) File ~/lwnet/train_cyclical.py:310 306 print(' Instantiating loss function', str(criterion)) 307 print(' Starting to train\n','-' * 10) --> 310 m1, m2, m3=train_model(model, optimizer, criterion, train_loader, val_loader, scheduler, grad_acc_steps, metric, experiment_path) 312 print("val_auc: %f" % m1) 313 print("val_dice: %f" % m2) ...

File ~/lwnet/utils/paired_transforms_tv04.py:1275, in RandomAffine.call(self, img, target) 1270 return F.affine(img, ret, resample=self.resample, fill=self.fill), \ 1271 F.affine(target, ret, resample=self.resample_tg, fill=self.fill) 1272 #return F.affine(img, ret, fill=self.fill), \ 1273 #F.affine(target, ret,fill=self.fill) 1274 # resample = False is by default nearest, appropriate for targets

-> 1275 return F.affine(img, *ret, resample=self.resample, fill=self.fill)

TypeError: affine() got an unexpected keyword argument 'resample'

agaldran commented 3 months ago

Hello,

Please have a look at this closed issue, it probably has to do with torch/torchvision versions (the ones in requirements.txt are too old):

https://github.com/agaldran/lwnet/issues/4

Adrian

reuben58male commented 3 months ago

Thank you, Adrian. It was very helpful. So the new versions just removed the 'resample' arg.