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

IndexError: list index out of range #3

Closed
ai1361720220000 opened this issue Jul 26, 2021 · 8 comments
Closed

IndexError: list index out of range #3

ai1361720220000 opened this issue Jul 26, 2021 · 8 comments

Comments

@ai1361720220000
Copy link

hello, when i run the training command, the error occurs. i'm confused about the H0 and H_1 parameters, what's the meaning of these two parameters?

Traceback (most recent call last):
File "train.py", line 88, in
main()
File "train.py", line 42, in main
train(model, dataset, visualizer, opt)
File "train.py", line 54, in train
for i, data in enumerate(dataset): # inner loop within one epoch
File "/home/notebook/data/personal/80303875/project/omnimatte/omnimatte/third_party/data/init.py", line 92, in iter
for i, data in enumerate(self.dataloader):
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1179, in _next_data
return self._process_data(data)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
data.reraise()
File "/opt/conda/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 1.
Original Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/notebook/data/personal/80303875/project/omnimatte/omnimatte/data/omnimatte_dataset.py", line 129, in getitem
data_t2 = self.get_transformed_item(index + 1, transform_params)
File "/home/notebook/data/personal/80303875/project/omnimatte/omnimatte/data/omnimatte_dataset.py", line 194, in get_transformed_item
bg_flow = self.get_background_flow(index, mask_w, mask_h) # 2, H, W
File "/home/notebook/data/personal/80303875/project/omnimatte/omnimatte/data/omnimatte_dataset.py", line 287, in get_background_flow
H_1 = self.homographies[index + 1]
IndexError: list index out of range

@erikalu
Copy link
Owner

erikalu commented Jul 26, 2021

Hi, what data are you training on? Is it the tennis demo or your custom video?

H_0 and H_1 are homographies for the current and next frame, respectively. This error is probably because the homography file isn't formatted correctly.

@ai1361720220000
Copy link
Author

ai1361720220000 commented Jul 26, 2021 via email

@erikalu
Copy link
Owner

erikalu commented Jul 26, 2021

That's strange, I just checked and I don't get this error, even without changing max_dataset_size.

The default number of training steps is 12k (the number of epochs it corresponds to will depend on the batch size you use). You may want to increase the number of training steps if you're using a small batch size.

@ai1361720220000
Copy link
Author

ai1361720220000 commented Jul 26, 2021 via email

@erikalu
Copy link
Owner

erikalu commented Jul 26, 2021

What GPU are you using? It took about 2 hours to run on 2 P100 GPUs.

@ai1361720220000
Copy link
Author

ai1361720220000 commented Jul 27, 2021 via email

@ai1361720220000
Copy link
Author

Hello, could you tell how to get zbar.pth for a new dataset. What's the zbar meaning? i also confused whether zbar would be update if it is set randomly in the network?

@erikalu
Copy link
Owner

erikalu commented Aug 2, 2021

zbar.pth is randomly initialized and saved if it doesn't already exist, otherwise the existing file is loaded. These values aren't updated during training. It is random fixed noise that represents the input for the background layer.

@erikalu erikalu closed this as completed Sep 2, 2021
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