You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I return aug only instead of aug.transforms.insert(0, RandAugment(4, 3)), there is no error.
Error
TypeError Traceback (most recent call last)
<timed exec> in <module>
D:\Datasets\Image dataset\Xray\SIAMESE-classifier\src\cross_vals.py in kfoldcv(model, data, epochs, n_splits, lr, batchsize, skip_tuning, aug)
70
71 #train on all train images
---> 72 model=train_dl(train_loader,epochs,model,"cuda",criterion,opt)
73 train_features,train_labels=get_features(train,model)
74 #now get embeddings of test data
D:\Datasets\Image dataset\Xray\SIAMESE-classifier\src\dl_training.py in train_dl(loader, epochs, model, device, criterion, opt)
120 model=model.to(device)
121 for _epoch in range(epochs):
--> 122 for batch in loader:
123 img1,img2,label=batch
124 img1_emb,img2_emb=model(img1.to(device)),model(img2.to(device))
C:\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py in __next__(self)
433 if self._sampler_iter is None:
434 self._reset()
--> 435 data = self._next_data()
436 self._num_yielded += 1
437 if self._dataset_kind == _DatasetKind.Iterable and \
C:\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py in _next_data(self)
473 def _next_data(self):
474 index = self._next_index() # may raise StopIteration
--> 475 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
476 if self._pin_memory:
477 data = _utils.pin_memory.pin_memory(data)
C:\Anaconda3\lib\site-packages\torch\utils\data\_utils\fetch.py in fetch(self, possibly_batched_index)
42 def fetch(self, possibly_batched_index):
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:
46 data = self.dataset[possibly_batched_index]
C:\Anaconda3\lib\site-packages\torch\utils\data\_utils\fetch.py in <listcomp>(.0)
42 def fetch(self, possibly_batched_index):
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:
46 data = self.dataset[possibly_batched_index]
D:\Datasets\Image dataset\Xray\SIAMESE-classifier\src\dataloader.py in __getitem__(self, index)
49 img1 = self.transform[1](image=np.array(img1))['image']
50 else:
---> 51 img0=self.transform[1](img0)
52 img1=self.transform[1](img1)
53
TypeError: 'NoneType' object is not callable
The text was updated successfully, but these errors were encountered:
Here the augmentation function.
Here is data loader
here is data loader
If I return
aug
only instead ofaug.transforms.insert(0, RandAugment(4, 3))
, there is no error.Error
The text was updated successfully, but these errors were encountered: