question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m now trying to train your model with my custom dataset. I tried using brox optical flow but it didn’t work, so I used dense optical flow instead. However, when I started training, I got an error like this:

Train_K7_flow_cocoTraceback (most recent call last):
  File "/content/drive/My Drive/action_recognition/Moc-Detection/src/train.py", line 167, in <module>
    main(opt)
  File "/content/drive/My Drive/action_recognition/Moc-Detection/src/train.py", line 95, in main
    log_dict_train = trainer.train(epoch, train_loader, train_writer)
  File "/content/drive/My Drive/action_recognition/Moc-Detection/src/trainer/moc_trainer.py", line 56, in train
    return self.run_epoch('train', epoch, data_loader, writer)
  File "/content/drive/My Drive/action_recognition/Moc-Detection/src/trainer/moc_trainer.py", line 74, in run_epoch
    for iter, batch in enumerate(data_loader):
  File "/usr/local/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 336, in __next__
    return self._process_next_batch(batch)
  File "/usr/local/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/usr/local/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/content/drive/My Drive/action_recognition/Moc-Detection/src/datasets/sample/sampler.py", line 120, in __getitem__
    draw_umich_gaussian(hm[ilabel], center_int, radius)
IndexError: index 20 is out of bounds for axis 0 with size 4

When I checked, brox-images are (240, 320, 3) and dense-images are the same, so I don’t understand how your algorithms think they are different. This is the image after I use dense optical flow 00004 This is the image after I use dense optical flow and Raises pixel 0 to 128 00007 I tried both and failed at the same error 😦 Can you help me? Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
npduyduccommented, Aug 27, 2020

Thank you for your help. This problem happened because my server was too slow. v(ಥ ̯ ಥ)v

0reactions
bit-scientistcommented, Jan 5, 2022

@npduyduc How do you prepare annotations for your custom dataset? Do you happen to have a step-by-step guideline to accomplish this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing Custom Datasets, DataLoaders and Transforms
torch.utils.data.Dataset is an abstract class representing a dataset. Your custom dataset should inherit Dataset and override the following methods:.
Read more >
Creating a custom Dataset and Dataloader in Pytorch - Medium
Creating a custom Dataset and Dataloader in Pytorch · The Torch Dataset class is basically an abstract class representing the dataset. · The...
Read more >
04. PyTorch Custom Datasets
A custom dataset is a collection of data relating to a specific problem you're working on. In essence, a custom dataset can be ......
Read more >
Custom dataset in Pytorch —Part 1. Images | by Utkarsh Garg
In this walkthrough, we'll learn how to load a custom image dataset for classification. The code for this walkthrough can also be found...
Read more >
How You can EASILY create Custom Datasets and Loaders!
Pytorch has some of the best tools to load your data and create datasets on the fly. We will cover examples of creating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found