open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
8.24k stars 2.61k forks source link

AttributeError: 'ConfigDict' object has no attribute 'test' #1967

Open MIMIWAWA opened 2 years ago

MIMIWAWA commented 2 years ago

Checklist

  1. I have searched related issues but cannot get the expected help.

Describe the bug AttributeError: 'ConfigDict' object has no attribute 'test'

  1. What command or script did you run?

    result = inference_segmentor(model, img)

  2. Did you make any modifications on the code or config? Did you understand what you have modified?

As the demo. Yes.

  1. What dataset did you use?

custom dataset

Environment

sys.platform: linux Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0] CUDA available: True GPU 0: NVIDIA A100-SXM4-40GB CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.2, V11.2.67 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 PyTorch: 1.12.1+cu116 PyTorch compiling details: PyTorch built with:

TorchVision: 0.13.1+cu116 OpenCV: 4.5.5 MMCV: 1.6.1 MMCV Compiler: GCC 9.4 MMCV CUDA Compiler: 11.2 MMSegmentation: 0.27.0+dd42fa8

Error traceback

Traceback (most recent call last): File "test_images_output.py", line 41, in result = inference_segmentor(model, img) File "/mmsegmentation/mmseg/apis/inference.py", line 84, in inference_segmentor test_pipeline = [LoadImage()] + cfg.data.test.pipeline[1:] File "/mmcv/mmcv/utils/config.py", line 50, in getattr raise ex AttributeError: 'ConfigDict' object has no attribute 'test'

Any help is appreciated!

MeowZheng commented 2 years ago

Would you mind providing the config file you used?