open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.06k stars 9.37k forks source link

mmdet.LoadImageFromFile is not in the transform registry #10112

Open rouge012 opened 1 year ago

rouge012 commented 1 year ago

KeyError: "class CocoDataset in mmdet/datasets/coco.py: 'mmdet.LoadImageFromFile is not in the transform registry. Please check whether the value of mmdet.LoadImageFromFile is 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'

windowsDL commented 1 year ago

I think missing LoadImageFromFile in transform registry in mmdet is the reason of this error, so I tried to fix this by the following steps:

  1. Insert class LoadImageFromFile (from the latest mmcv/mmcv/transforms/loading.py) into mmdetection/mmdet/datasets/transforms/loading.py
  2. pip uninstall mmdet
  3. cd to the mmdetection directory
  4. pip install -v -e .
wqh17101 commented 1 year ago

Any official solutions? It is a serious blocking problem. I install mmdet by pip install mmdet==3.0.0

wqh17101 commented 1 year ago

@hhaAndroid Can you help us to solve this problem?

Xiaona-Zhao commented 2 months ago

It works for me when I write the LoadImageFromFile in train_pipeline, and then add train_dataloader = dict(dataset=dict(pipeline=train_pipeline)) behind