open-mmlab / mmsegmentation

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

How to evaluate trained models with metrics? #3385

Open Klopotek0 opened 11 months ago

Klopotek0 commented 11 months ago

I trained my models according to this script: https://colab.research.google.com/github/open-mmlab/mmsegmentation/blob/main/demo/MMSegmentation_Tutorial.ipynb Now I'd like to evaluate trained model on diffrent dataset with metrics, I couldnt find anything to help me get through the proccess. Also is there a way to plot the metrics of the training/evaluation?

Klopotek0 commented 11 months ago

Traceback (most recent call last): File "/content/mmsegmentation/tools/test.py", line 123, in <module> main() File "/content/mmsegmentation/tools/test.py", line 119, in main runner.test() File "/usr/local/lib/python3.10/dist-packages/mmengine/runner/runner.py", line 1816, in test self._test_loop = self.build_test_loop(self._test_loop) # type: ignore File "/usr/local/lib/python3.10/dist-packages/mmengine/runner/runner.py", line 1604, in build_test_loop loop = LOOPS.build( File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg obj = obj_cls(**args) # type: ignore File "/usr/local/lib/python3.10/dist-packages/mmengine/runner/loops.py", line 410, in __init__ super().__init__(runner, dataloader) File "/usr/local/lib/python3.10/dist-packages/mmengine/runner/base_loop.py", line 26, in __init__ self.dataloader = runner.build_dataloader( File "/usr/local/lib/python3.10/dist-packages/mmengine/runner/runner.py", line 1370, in build_dataloader dataset = DATASETS.build(dataset_cfg) File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py", line 100, in build_from_cfg raise KeyError( KeyError: 'StanfordBackgroundDataset is not in the mmseg::dataset registry. Please check whether the value ofStanfordBackgroundDatasetis correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module' I run to this error, even though I registered the dataset as in tutorial.