Suanmd / TR-MISR

47 stars 7 forks source link

RuntimeError: stack expects each tensor to be equal size, but got [24, 32, 64] at entry 0 and [24, 64, 32] at entry 1 #3

Closed mramzy25 closed 2 years ago

mramzy25 commented 2 years ago

I got that error during running train.py. I couldn't know how to solve it

This is also the trace back: RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Users\user\anaconda3\envs\endo\lib\site-packages\torch\utils\data_utils\worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "C:\Users\user\anaconda3\envs\endo\lib\site-packages\torch\utils\data_utils\fetch.py", line 52, in fetch return self.collate_fn(data) File "C:\Users\user\Desktop\TR-MISR-master\src\utils.py", line 65, in call return self.collateFunction(batch) File "C:\Users\user\Desktop\TR-MISR-master\src\utils.py", line 118, in collateFunction padded_lr_batch = torch.stack(lr_batch, dim=0) RuntimeError: stack expects each tensor to be equal size, but got [24, 32, 64] at entry 0 and [24, 64, 32] at entry 1

Suanmd commented 2 years ago

This problem looks like a DataLoader issue. Please double check the data size. If the image is not square in size, you may need to add code for the DataLoader.

mramzy25 commented 2 years ago

Thanks a lot for the help