PaddlePaddle / PaddleSeg

Easy-to-use image segmentation library with awesome pre-trained model zoo, supporting wide-range of practical tasks in Semantic Segmentation, Interactive Segmentation, Panoptic Segmentation, Image Matting, 3D Segmentation, etc.
https://arxiv.org/abs/2101.06175
Apache License 2.0
8.69k stars 1.68k forks source link

[General Issue] 'ValueError: The dataset is not Found' while generating outputs using Pre-Trained models #1809

Closed varungupta31 closed 2 years ago

varungupta31 commented 2 years ago
  1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) - 2.4.0
  2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) - 2.2.2
  3. Operation system: (e.g. Linux/Windows/MacOS) - Linux
  4. Python version: (e.g. Python3.6/7/8) - 3.7.0
  5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) - 10.2/7.6.5
  6. Additional context: (Add any other context about the problem) :

I'm trying to run segmentation on custom images using the pre-trained model - 'Segformer B5' I have completed the installation sucessfully.

Upon running the script -

python predict.py \
       --config configs/segformer/segformer_b5_cityscapes_1024x1024_160k.yml \
       --model_path model/model.pdparams\
       --image_path docs/images/city.jpg \
       --save_dir output/result

or

python predict.py \
       --config configs/segformer/segformer_b5_cityscapes_1024x512_160k.yml \
       --model_path https://bj.bcebos.com/paddleseg/dygraph/cityscapes/segformer_b5_cityscapes_1024x1024_160k/model.pdparams \
       --image_path docs/images/city.jpg \
       --save_dir output/result

I'm getting the following error:

Traceback (most recent call last):
  File "predict.py", line 175, in <module>
    main(args)
  File "predict.py", line 144, in main
    val_dataset = cfg.val_dataset
  File "/home2/varungupta/PaddleSeg/paddleseg/cvlibs/config.py", line 351, in val_dataset
    return self._load_object(_val_dataset)
  File "/home2/varungupta/PaddleSeg/paddleseg/cvlibs/config.py", line 385, in _load_object
    return component(**params)
  File "/home2/varungupta/PaddleSeg/paddleseg/datasets/cityscapes.py", line 75, in __init__
    "The dataset is not Found or the folder structure is nonconfoumance."
ValueError: The dataset is not Found or the folder structure is nonconfoumance.

However, when I run:

python predict.py \
       --config configs/quick_start/bisenet_optic_disc_512x512_1k.yml \
       --model_path https://bj.bcebos.com/paddleseg/dygraph/optic_disc/bisenet_optic_disc_512x512_1k/model.pdparams\
       --image_path docs/images/optic_test_image.jpg \
       --save_dir output/result

the optic_disc_seg dataset starts downloading: (thus my installation is correct)

Connecting to https://paddleseg.bj.bcebos.com/dataset/optic_disc_seg.zip
Downloading optic_disc_seg.zip

I want to run segmentation of street images, using suitable pre-trained model. How can I run the pre-trained Segformer B5 model on custom images? Thank you. @michaelowenliu

juncaipeng commented 2 years ago

Hi, this is a known problem and we are fixing it. To avoid this problem, you can replace the train and validation dataset information in segformer_b5.yaml with the train and validation dataset information in bisenet_optic_disc_512x512_1k.yaml.

hebangwen commented 2 years ago

Hi, I also have this problem. My solution is to comment all code that raises Exceptions. After commenting all of this code, it will begin to inference immediately.

varungupta31 commented 2 years ago

@BangwenHe Thanks for the reply, I partially completed my need to use this segmenter by using Detic instead for the time being/If I need to return to PaddleSeg for some reason, I will keep this in mind. This hopefully helps someone else facing similar issue as well :)

Keeping the thread open until it is officially resolved by the dev team.

michaelowenliu commented 2 years ago

@BangwenHe @varungupta31 Hi all, we have fixed the bug after merging this pr, https://github.com/PaddlePaddle/PaddleSeg/pull/1816. Please use the latest develop branch.