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

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

Open
abhishek0696 opened this issue Oct 16, 2021 · 1 comment

Comments

@abhishek0696
Copy link

Hello. I have run the code on google colab for a dry run and it was working just fine. I am now running it on a GPU-enabled server. But getting this error. "ValueError: num_samples should be a positive integer value, but got num_samples=0".

I have ensured that the Videos/ folder and the 2 csvs are in the same folder from where I am running the python script.
I have a doubt if the BATCH SIZE and NUM_WORKERS can be the reason for this. And if yes, what should I change it to, increase or decrease?

I have attached screenshots and copied the content of the error (output.stdout) and the code in my python script which I run.

Please help, and thanks in advance!!!!

THE ERROR:

Traceback (most recent call last):
File "echoDynamic.py", line 18, in
run_test=True)
File "/home/ashivdeo/Echonet/Echonet/echonet/utils/segmentation.py", line 100, in run
mean, std = echonet.utils.get_mean_and_std(echonet.datasets.Echo(split="train"))
File "/home/ashivdeo/Echonet/Echonet/echonet/utils/init.py", line 103, in get_mean_and_std
dataset, batch_size=batch_size, num_workers=num_workers, shuffle=True)
File "/home/ashivdeo/Echonet/Echonet/test/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 270, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type]
File "/home/ashivdeo/Echonet/Echonet/test/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 103, 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

THE CODE:

import sys
sys.path.append("/home/ashivdeo/Echonet/Echonet/")

import echonet
echonet.utils.segmentation.run(
num_epochs=50,
modelname="deeplabv3_resnet50",
pretrained=False,
output=None,
device=None,
n_train_patients=None,
num_workers=0,
batch_size=1,
seed=0,
lr_step_period=None,
save_segmentation=True,
block_size=2,
run_test=True)

git_ecdy_2
git_ecdy_1

@yannmean
Copy link

I ran into the same issue. May the developer help, please?

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