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.

ValueError: num_samples should be a positive integer value, but got num_samples=0

See original GitHub issue

RUNDIR: runs\seg_pascal\1980 Traceback (most recent call last): File "train.py", line 226, in <module> train(cfg, writer, logger) File "train.py", line 61, in train t_loader, batch_size=cfg["training"]["batch_size"], num_workers=cfg["training"]["n_workers"], shuffle=True File "C:\Users\yp\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 176, in __init__ sampler = RandomSampler(dataset) File "C:\Users\yp\Anaconda3\lib\site-packages\torch\utils\data\sampler.py", line 66, in __init__ "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integer value, but got num_samples=0 How can I solve this problem?Thank you!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

137reactions
Auth0rM0rgancommented, Jun 4, 2019

You set the wrong path and model cannot find the training data to start training!

10reactions
sparachi1011commented, Feb 22, 2020

Hi, I checked the input data path and it was correct. But still i’m getting “ValueError: num_samples should be a positive integer value, but got num_samples=0”.

Could some one help or provide any work around.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Num_samples should be a positive integer ... - PyTorch Forums
Hello everybody, I am new to PyTorch. I have a problem when I tried to train my data. When I run my program...
Read more >
ValueError: num_samples should be a positive integer value ...
I have the error of the title ValueError: num_samples should be a positive integer value, but got num_samples=0 because basically I am ...
Read more >
num_samples should be a positive integeral value, but got ...
Has anyone encountered and solved the below error: Error: ValueError: num_samples should be a positive integeral value, but got num_samples= ...
Read more >
num_samples should be a positive integer value ... - Medium
iam getting this error while executing this code. “num_samples should be a positive integer value, but got num_samples=0” is published by ...
Read more >
brian2hears.filtering.filterbank — brian2hears documentation
__init__`` will set the number of channels equal to the number of source channels, but we ... raise ValueError('All sources must have the...
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