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
Encounter training phase problem with Places2 256 size dataset , looking forward help to solve this.
Traceback (most recent call last):
File "train.py", line 2, in
main(mode=1)
File "/home/user/workspace/user/performance/edge-informed-sisr/main.py", line 50, in main
model.train()
File "/home/user/workspace/user/performance/edge-informed-sisr/src/edge_match.py", line 150, in train
self.sample()
File "/home/user/workspace/user/performance/edge-informed-sisr/src/edge_match.py", line 252, in sample
items = next(self.sample_iterator)
File "/home/user/workspace/user/performance/edge-informed-sisr/src/dataset.py", line 146, in create_iterator
for item in sample_loader:
File "/home/user/anaconda3/envs/user_workspace/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 346, in next
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/user/anaconda3/envs/user_workspace/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/home/user/anaconda3/envs/user_workspace/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 79, in default_collate
return [default_collate(samples) for samples in transposed]
File "/home/user/anaconda3/envs/user_workspace/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 79, in
return [default_collate(samples) for samples in transposed]
File "/home/user/anaconda3/envs/user_workspace/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 3 and 1 in dimension 1 at /opt/conda/conda-bld/pytorch_1570710743984/work/aten/src/TH/generic/THTensor.cpp:689
Note : This problem encounter while evaluation dataset not training dataset
The text was updated successfully, but these errors were encountered:
It means at least one of your images isn't formatted correctly (eg. greyscale).
Here's a hacked together script I made to find and move those images to another folder. Just be aware that I haven't done any checks for filenames, so any other file in the directory will be moved as well.
import os
from scipy.misc import imread
from tqdm import tqdm
directory = 'INDIRECTORY'
movedir = 'OUTDIRECTORY'
for filename in tqdm(os.listdir(directory)):
file = directory + filename
try:
im = imread(file)
#print(filename + " is " + str(im.shape))
if im.shape != (1024,1024,3):
try:
os.rename(file, movedir + filename)
except:
continue
print(filename + " is " + str(im.shape))
except:
print("Failed to load " + str(filename))
try:
os.rename(file, movedir + filename)
except:
continue
Encounter training phase problem with Places2 256 size dataset , looking forward help to solve this.
Note : This problem encounter while evaluation dataset not training dataset
The text was updated successfully, but these errors were encountered: