ClementPinard / FlowNetPytorch

Pytorch implementation of FlowNet by Dosovitskiy et al.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the related error is:

mahsa14775 opened this issue · comments

AssertionError                            Traceback (most recent call last)
<ipython-input-73-6d723b6a94dc> in <module>
     45 model.eval()
     46 
---> 47 for i, (inp, target) in enumerate(test_loader):
     48         target = target.cuda()
     49         gt = torch.cat((gt, target), 0)

~\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\dataloader.py in __next__(self)
    361 
    362     def __next__(self):
--> 363         data = self._next_data()
    364         self._num_yielded += 1
    365         if self._dataset_kind == _DatasetKind.Iterable and \

~\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\data\dataloader.py in _next_data(self)
    401     def _next_data(self):
    402         index = self._next_index()  # may raise StopIteration
--> 403         data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
    404         if self._pin_memory:
    405             data = _utils.pin_memory.pin_memory(data)

~\AppData\Local\Programs\Python\Python38\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]

~\AppData\Local\Programs\Python\Python38\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]

~\read_data.py in __getitem__(self, index)
     47         label = self.labels[index]
     48         if self.transform is not None:
---> 49             image = self.transform(image)
     50         return image, torch.FloatTensor(label)
     51 

~\AppData\Local\Programs\Python\Python38\lib\site-packages\torchvision\transforms\transforms.py in __call__(self, img)
     59     def __call__(self, img):
     60         for t in self.transforms:
---> 61             img = t(img)
     62         return img
     63 

~\AppData\Local\Programs\Python\Python38\lib\site-packages\torchvision\transforms\transforms.py in __init__(self, lambd)
    353 
    354     def __init__(self, lambd):
--> 355         assert callable(lambd), repr(type(lambd).__name__) + " object is not callable"
    356         self.lambd = lambd
    357 

AssertionError: 'tuple' object is not callable

normalize = transforms.Normalize([0.485, 0.456, 0.406],

Closing this as it is problably related to #88