WenmuZhou / PAN.pytorch

A unofficial pytorch implementation of PAN(PSENet2): Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network
Apache License 2.0
418 stars 112 forks source link

num_samples=0 #4

Closed ghost closed 5 years ago

ghost commented 5 years ago

@WenmuZhou Thank you for your hard work,

I am trying to train icdar2015, when running train.py I get error. My config.json My training & testing list, and file tree.

The error message:

(final) home@home-desktop:~/p2/PAN.pytorch-master$ python train.py
Traceback (most recent call last):
  File "train.py", line 33, in <module>
    main(config)
  File "train.py", line 18, in main
    train_loader, eval_loader = get_dataloader(config['data_loader']['type'], config['data_loader']['args'])
  File "/home/home/p2/PAN.pytorch-master/data_loader/__init__.py", line 98, in get_dataloader
    num_workers=module_args['loader']['num_workers'])
  File "/home/home/anaconda3/envs/final/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 213, in __init__
    sampler = RandomSampler(dataset)
  File "/home/home/anaconda3/envs/final/lib/python3.6/site-packages/torch/utils/data/sampler.py", line 94, 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
ghost commented 5 years ago

Solved, the issue was caused because of wrong path in the lists.