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

trian CUB-200-2011 error #28

Open
successhaha opened this issue Aug 26, 2021 · 1 comment
Open

trian CUB-200-2011 error #28

successhaha opened this issue Aug 26, 2021 · 1 comment

Comments

@successhaha
Copy link

hi,can you help me? Thank you very much.
Traceback (most recent call last):
File "main.py", line 580, in
main()
File "main.py", line 571, in main
trainer.train()
File "main.py", line 84, in train
for iteration, batch in enumerate(self.data_loader'train'):
File "/home/wuchenxi/Desktop/DPGN-master/venv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/home/wuchenxi/Desktop/DPGN-master/venv/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/home/wuchenxi/Desktop/DPGN-master/venv/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/wuchenxi/Desktop/DPGN-master/venv/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/wuchenxi/Desktop/DPGN-master/venv/lib/python3.7/site-packages/torchnet/dataset/listdataset.py", line 54, in getitem
return self.load(self.list[idx])
File "/home/wuchenxi/Desktop/DPGN-master/dataloader.py", line 285, in load_function
support_data, support_label, query_data, query_label = self.get_task_batch()
File "/home/wuchenxi/Desktop/DPGN-master/dataloader.py", line 259, in get_task_batch
task_class_list = random.sample(self.full_class_list, self.num_ways)
File "/usr/local/python3.7.5/lib/python3.7/random.py", line 321, in sample
raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative

@AlienceGG
Copy link
Collaborator

hi, successhaha
The log says "ValueError: Sample larger than population or is negative". Please check the value of self.full_class_list and self.num_ways in the task_class_list = random.sample(self.full_class_list, self.num_ways) .

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