When I use my own dataset, I only use the baseline, but it's wrong.
Traceback (most recent call last):
File "train_baseline.py", line 346, in
num_epochs=130)
File "train_baseline.py", line 227, in train_model
for data in dataloaders[phase]:
File "/home/chenghj/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 281, in next
return self._process_next_batch(batch)
File "/home/chenghj/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/home/chenghj/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "train_baseline.py", line 140, in getitem
result = {'img': data_transforms'train', 'label': self.img_label[idx], 'flag':self.img_flag[idx]} # flag=0 for ture data and 0 for generated data
File "/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py", line 49, in call
img = t(img)
File "/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py", line 421, in call
i, j, h, w = self.get_params(img, self.size)
File "/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py", line 399, in get_params
i = random.randint(0, h - th)
File "/usr/lib/python2.7/random.py", line 242, in randint
return self.randrange(a, b+1)
File "/usr/lib/python2.7/random.py", line 218, in randrange
raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
ValueError: empty range for randrange() (0,-62, -62)
When I use my own dataset, I only use the baseline, but it's wrong. Traceback (most recent call last): File "train_baseline.py", line 346, in
num_epochs=130)
File "train_baseline.py", line 227, in train_model
for data in dataloaders[phase]:
File "/home/chenghj/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 281, in next
return self._process_next_batch(batch)
File "/home/chenghj/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/home/chenghj/.local/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "train_baseline.py", line 140, in getitem
result = {'img': data_transforms'train', 'label': self.img_label[idx], 'flag':self.img_flag[idx]} # flag=0 for ture data and 0 for generated data
File "/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py", line 49, in call
img = t(img)
File "/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py", line 421, in call
i, j, h, w = self.get_params(img, self.size)
File "/usr/local/lib/python2.7/dist-packages/torchvision/transforms/transforms.py", line 399, in get_params
i = random.randint(0, h - th)
File "/usr/lib/python2.7/random.py", line 242, in randint
return self.randrange(a, b+1)
File "/usr/lib/python2.7/random.py", line 218, in randrange
raise ValueError, "empty range for randrange() (%d,%d, %d)" % (istart, istop, width)
ValueError: empty range for randrange() (0,-62, -62)