Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Training on cityscape dataset #51

Open
soheilAppear opened this issue Jul 31, 2020 · 1 comment
Open

Issue with Training on cityscape dataset #51

soheilAppear opened this issue Jul 31, 2020 · 1 comment

Comments

@soheilAppear
Copy link

Hello. I installed your package correctly and I wanted to do the training with the cityscape datasets but I got this error:

#torch.nn.NLLLoss for more details.
warnings.warn("NLLLoss2d has been deprecated. "
<class 'main.CrossEntropyLoss2d'>
----- TRAINING - EPOCH 1 -----
/usr/local/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:123: UserWarning: Detected call of lr_scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr_scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
"https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
/usr/local/lib/python3.6/site-packages/torch/optim/lr_scheduler.py:143: UserWarning: The epoch parameter in scheduler.step() was not necessary and is being deprecated where possible. Please use scheduler.step() to step the scheduler. During the deprecation, if epoch is different from None, the closed form is used instead of the new chainable form, where available. Please open an issue if you are unable to replicate your use case: https://github.com/pytorch/pytorch/issues/new/choose.
warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)
LEARNING RATE: 0.0005
Traceback (most recent call last):
File "main.py", line 507, in
main(parser.parse_args())
File "main.py", line 480, in main
model = train(args, model, False) #Train decoder
File "main.py", line 215, in train
for step, (images, labels) in enumerate(loader):
File "/usr/local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 363, in next
data = self._next_data()
File "/usr/local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 989, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1014, in _process_data
data.reraise()
File "/usr/local/lib/python3.6/site-packages/torch/_utils.py", line 395, in reraise
raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 185, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/soheil/erfnet_pytorch/train/dataset.py", line 86, in getitem
filenameGt = self.filenamesGt[index]
IndexError: list index out of range

@ftlong6666
Copy link

@soheilAppear I have the similar condition and solved the IndexError: list index out of range error . First you need to check if the files ended with "_labelTrainIds.png" is exist in your dataset folder Cityscapes/gtFine/train/[city_name]/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants