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 #360

Open
duongkhoalam197 opened this issue Feb 25, 2023 · 0 comments

Comments

@duongkhoalam197
Copy link

I'm trying to run demo.py but "ValueError: num_samples should be a positive integer value, but got num_samples=0"
Any solution :(

(DB) C:\AIP391\DB>python demo.py experiments/seg_detector/totaltext_resnet18_deform_thre.yaml --image_path datasets/img651.jpg --resume models/totaltext_resnet18 --polygon --box_thresh 0.7 --visualize
verbose: True
Initializing log dir for workspace\SegDetectorModel-seg_detector\deformable_resnet18\L1BalanceCELoss
Traceback (most recent call last):
File "demo.py", line 148, in
main()
File "demo.py", line 41, in main
experiment = Configurable.construct_class_from_config(experiment_args)
File "C:\AIP391\DB\concern\config.py", line 130, in construct_class_from_config
return cls(**args)
File "C:\AIP391\DB\experiment.py", line 96, in init
self.load_all(**kwargs)
File "C:\AIP391\DB\concern\config.py", line 143, in load_all
self.load(name, **kwargs)
File "C:\AIP391\DB\concern\config.py", line 151, in load
(kwargs[state_name], cmd)))
File "C:\AIP391\DB\concern\config.py", line 164, in create_member_from_config
return cls(**args, cmd=cmd)
File "C:\AIP391\DB\experiment.py", line 37, in init
self.load_all(**kwargs)
File "C:\AIP391\DB\concern\config.py", line 143, in load_all
self.load(name, **kwargs)
File "C:\AIP391\DB\concern\config.py", line 151, in load
(kwargs[state_name], cmd)))
File "C:\AIP391\DB\concern\config.py", line 164, in create_member_from_config
return cls(**args, cmd=cmd)
File "C:\AIP391\DB\data\data_loader.py", line 57, in init
worker_init_fn=default_worker_init_fn)
File "C:\Users\lam19\anaconda3\envs\DB\lib\site-packages\torch\utils\data\dataloader.py", line 262, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore
File "C:\Users\lam19\anaconda3\envs\DB\lib\site-packages\torch\utils\data\sampler.py", line 104, 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

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

1 participant