-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A bug for show_result_pyplot(): 'EncoderDecoder' object has no attribute 'dataset_meta' #2299
Comments
you can refer to this :https:/open-mmlab/mmengine/blob/main/mmengine/runner/runner.py#L1939 |
Thanks a lot! I read the code you referred to and added result = inference_model(model, img)
plt.figure(figsize=(8, 6))
model.dataset_meta = dict(classes = classes, palette = palette)
vis_result = show_result_pyplot(model, img, result, save_dir='result_demo.jpg')
plt.imshow(mmcv.bgr2rgb(vis_result)) |
The genuine model.dataset_meta just like : In addition, you can make sure the dataset_meta is in your config. |
#2326 |
Closing the issue, as there is no activity for a while. |
mmsegmentation/mmseg/apis/inference.py
Line 197 in 7927591
When running the https:/open-mmlab/mmsegmentation/blob/dev-1.x/demo/MMSegmentation_Tutorial.ipynb , an attribute error came.
When I referred to the doc and https://mmsegmentation.readthedocs.io/zh_CN/dev-1.x/_modules/mmseg/models/segmentors/encoder_decoder.html#EncoderDecoder (souce code) , I did not find the attribute'dataset_meta'.
What command or script did you run?
https:/open-mmlab/mmsegmentation/blob/dev-1.x/demo/MMSegmentation_Tutorial.ipynb
Did you make any modifications on the code or config? Did you understand what you have modified?
no modifications.
What dataset did you use?
iccv09Data
Environment
sys.platform: linux
Python: 3.8.10 (default, Jun 4 2021, 15:09:15) [GCC 7.5.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 2080 Ti
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.3, V11.3.109
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
PyTorch: 1.11.0+cu113
PyTorch compiling details: PyTorch built with:
TorchVision: 0.12.0+cu113
OpenCV: 4.6.0
MMEngine: 0.3.1
MMSegmentation: 1.0.0rc1+7927591
Error traceback
The text was updated successfully, but these errors were encountered: