Getting error while feeding custom dataset
See original GitHub issueI want to train the reidentification model on VeRi vehicle dataset. I followed the instructions given here on how to use custom dataset: https://kaiyangzhou.github.io/deep-person-reid/user_guide.html#use-your-own-dataset
When I try to train “hacnn” model on this custom (VeRi) dataset, I am not able to train the model. Please find below the dataset statistics and the error that I am getting:
=> Loading train (source) dataset
=> Loaded VeRiDataset
----------------------------------------
subset | # ids | # images | # cameras
----------------------------------------
train | 575 | 37746 | 20
query | 200 | 1678 | 19
gallery | 200 | 11579 | 19
----------------------------------------
=> Loading test (target) dataset
=> Loaded VeRiDataset
----------------------------------------
subset | # ids | # images | # cameras
----------------------------------------
train | 575 | 37746 | 20
query | 200 | 1678 | 19
gallery | 200 | 11579 | 19
----------------------------------------
**************** Summary ****************
train : ['veri_dataset']
# train datasets : 1
# train ids : 575
# train images : 37746
# train cameras : 20
test : ['veri_dataset']
*****************************************
=> Start training
/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torch/nn/functional.py:2457: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
Traceback (most recent call last):
File "train_torchreid.py", line 52, in <module>
print_freq=10
File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/engine/engine.py", line 100, in run
self.train(epoch, max_epoch, trainloader, fixbase_epoch, open_layers, print_freq)
File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/engine/image/softmax.py", line 99, in train
loss = self._compute_loss(self.criterion, outputs, pids)
File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/engine/engine.py", line 302, in _compute_loss
loss = DeepSupervision(criterion, outputs, targets)
File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/losses/__init__.py", line 21, in DeepSupervision
loss += criterion(x, y)
File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/home/rajat/MyPC/DFKI/MasterThesis/Vehicle_Reidentification/veri/lib/python3.6/site-packages/torchreid-0.7.8-py3.6-linux-x86_64.egg/torchreid/losses/cross_entropy_loss.py", line 47, in forward
targets = torch.zeros(log_probs.size()).scatter_(1, targets.unsqueeze(1).data.cpu(), 1)
RuntimeError: Invalid index in scatter at /pytorch/aten/src/TH/generic/THTensorEvenMoreMath.cpp:551
Note: The same code is working fine if I use “market1501” dataset instead of my custom one.
Please help me in solving this issue.
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Why is my custom dataset giving attribute error? - Stack Overflow
Images is a 2d list of Pillow images and string labels and the createimages function works outside of the class. I am not...
Read more >How to get rid of custom tool errors on dataset designer save ...
I upgraded to VS 2015 from VS 2013 and now anytime I try to make changes to datasets via the dataset designer, I...
Read more >Fix upload errors with feeds in business data - Google Ads Help
Fix upload errors with feeds in business data. If your data set or feed isn't formatted right, this can prevent your ads from...
Read more >Step-by-step instructions for training YOLOv7 on a Custom ...
Follow this guide to get step-by-step instructions for running YOLOv7 model training within a Gradient Notebook on a custom dataset.
Read more >Solved: Re: Dataset status - check error - Dataiku Community
So you can use "Python check" instead of numeric check for checking the column value ranges. In Python check, you can write your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you need to relabel the training images so that the label starts from 0 and increments by 1 (think about how the classification layer is constructed and how a one-hot vector is generated given a label) e.g. raw_label=>new_label 1=>0 3=>1 4=>2 7=>3 8=>4
there is one simple way to convert the label
@Rajat-Mehta
Could you tell me your custom_datset code?