Bedrettin-Cetinkaya / RankED

MIT License
20 stars 3 forks source link

an error when running the test.py script. #6

Open mjz0110 opened 5 months ago

mjz0110 commented 5 months ago

Hi,I encountered an error when running the test.py script. Here are the details: Command Executed: python tools/test.py --config configs/APLoss/base_320_fullData_bsds.py --checkpoint checkpoints/iter_200000_BSDS.pth --tmpdir results Error Traceback: Traceback (most recent call last): File "tools/test.py", line 147, in main() File "tools/test.py", line 112, in main dataset = build_dataset(cfg.data.test) File "/home/haov/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.8/site-packages/mmseg/datasets/builder.py", line 85, in build_dataset dataset = build_from_cfg(cfg, DATASETS, default_args) File "/home/haov/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.8/site-packages/mmcv/utils/registry.py", line 61, in build_from_cfg raise KeyError( KeyError: 'BSDSDataset is not in the dataset registry'

could you please tell me how to solve the problem?Thanks for your help!

Xeuphoria233 commented 4 months ago

I have encountered the same issue, and here's how I fix it:

  1. Uninstall the original mmsegmentation (to force the usage of customized mmseg in RankED)
  2. Add path if necessary in your test.py: sys.path.append('path/to/RankED') Then the customized mmseg.datasets.builder.build_dataset will register BSDSDataset. Check if this could help.
Bedrettin-Cetinkaya commented 3 months ago

I think you need to run the following command. pip install -e .