bowenc0221 / panoptic-deeplab

This is Pytorch re-implementation of our CVPR 2020 paper "Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation" (https://arxiv.org/abs/1911.10194)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion Error : Please run `python cityscapesscripts/preparation/createPanopticImgs.py` to generate label files

bansilol opened this issue · comments

Just like the first issue by xyry here , I have downloaded the dataset and prepared it using the following commands:

CITYSCAPES_DATASET=/path/to/abovementioned/cityscapes python cityscapesscripts/preparation/createTrainIdLabelImgs.py
CITYSCAPES_DATASET=/path/to/abovementioned/cityscapes python cityscapesscripts/preparation/createPanopticImgs.py

Because of some storage issues the dataset is in two parts right now:
Location 1:
gtFine
│ ├── cityscapes_panoptic_test
│ ├── cityscapes_panoptic_test.json
│ ├── cityscapes_panoptic_train
│ ├── cityscapes_panoptic_train.json
│ ├── cityscapes_panoptic_val
│ ├── cityscapes_panoptic_val.json
│ ├── test
│ ├── train
│ └── val

and Location 2:
├── leftImg8bit
│ ├── test
│ ├── train
│ └── val

During the registration of builtin datasets the dataset with name cityscapes_fine_panoptic_train has image_dir to the location 2 gt_dir to location 1 and gt_json to the json file in location 1.

Currently the env variable DETECTRON2_DATASETS is pointing to the location 1. While running the training I am getting the following error:

File "/usr/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/bansi/detectron2/projects/Panoptic-DeepLab/train_net.py", line 171, in
args=(args,),
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/engine/launch.py", line 82, in launch
main_func(*args)
File "/home/bansi/detectron2/projects/Panoptic-DeepLab/train_net.py", line 157, in main
trainer = Trainer(cfg)
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/engine/defaults.py", line 378, in init
data_loader = self.build_train_loader(cfg)
File "/home/bansi/detectron2/projects/Panoptic-DeepLab/train_net.py", line 98, in build_train_loader
return build_detection_train_loader(cfg, mapper=mapper)
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/config/config.py", line 207, in wrapped
explicit_args = _get_args_from_config(from_config, *args, **kwargs)
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/config/config.py", line 245, in _get_args_from_config
ret = from_config_func(*args, **kwargs)
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/data/build.py", line 344, in _train_loader_from_config
proposal_files=cfg.DATASETS.PROPOSAL_FILES_TRAIN if cfg.MODEL.LOAD_PROPOSALS else None,
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/data/build.py", line 241, in get_detection_dataset_dicts
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/data/build.py", line 241, in
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in names]
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/data/catalog.py", line 58, in get
return f()
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/data/datasets/cityscapes_panoptic.py", line 176, in
key, lambda x=image_dir, y=gt_dir, z=gt_json: load_cityscapes_panoptic(x, y, z, meta)
File "/home/bansi/thesis_env/lib/python3.6/site-packages/detectron2/data/datasets/cityscapes_panoptic.py", line 81, in load_cityscapes_panoptic
), "Please run python cityscapesscripts/preparation/createPanopticImgs.py to generate label files." # noqa
AssertionError: Please run python cityscapesscripts/preparation/createPanopticImgs.py to generate label files

Can you please help me what can I do in this situation?

Run this command export DETECTRON2_DATASETS=/path/to/datasets
( I kept the path to detectron2/datasets)
Put all the dataset files in this path only and then run the cityscapes scripts