Open tusharsvaidya opened 2 years ago
This error indicates your custom dataset hasn't been registered. Please refer to https://github.com/open-mmlab/mmdetection/blob/master/docs/en/tutorials/customize_dataset.md.
A customized module is not in the registry has the following reasons:
custom_import
as introduced in the documentationmmdet
package in the current directory is not used. This happens when you install mmdet through pip install mmdet
but modify and want to use the code of mmdet in your working directory. Please make sure the mmdet in your working directory is used.Dear @ZwwWayne , i'm facing the same issue as described by @tusharsvaidya.
I saw different issues about the problem "MY_DATASET is not in the dataset registry" (eg #5800 or #6149) with different answers but i was not able to make it work for me. As current issue is the most recent on this topic, I'm very interested in your potential help.
My first question is how can we figure out if we are in case 1 (module not imported through init.py) or 2 (module imported through init.py) ? My second question is about case 2 : how can we "make sure the mmdet in your working directory is used" ?
In my case, I created following files/folder : ~/mmdetection/mmdet/datasets/my_dataset.py (following https://github.com/open-mmlab/mmdetection/blob/master/docs/en/tutorials/customize_dataset.md.), with implementation of class 'my_dataset' inheriting from 'CustomDataset' ~/mmdetection/data/my_dataset (with images and annotation file) ~/mmdetection/configs/base/datasets/my_dataset.py (with command "dataset_type = 'my_dataset' and rest of config) ~/mmdetection/configs/my_config/my_config.py (with base pointing to base/models/faster-rcnn and base/datasets/my_dataset.py)
and I also modified ~/mmdetection/mmdet/datasets/init.py to include 'MY_DATASET' in all list
then i launch "python ~mmdetection/tools/train.py ~/mmdetection/configs/my_config/my_config.py
but i'm stuck with "MY_DATASET is not in the dataset registry"
Note : as mentionned in issue #5800, i tried inserting "import pdb; pdb.set_trace()" in ~/mmdetection/mmdet/datasets/my_dataset.py before section "@DATASETS.register_module()" and with ~/mmdetection/tools/train.py configs/my_config/my_config.py the training did not stopped and it blocked at "MY_DATASET is not in the dataset registry". Note : if i make my dataset compliant with CocoDataset format, i can run training and testing fine but i need a customized dataset for my project
Thanks for your valuable help !
Dear @jpmazellier, I got the same issue after updating the latest mmdet version through
pip install --upgrade mmdet
. However at the very beginning, I installed mmdetection throughgit clone
, that's mean in my environment two mmdet packages existed, and all scripts in mmdetection used the relative imports so that the custom dataset cannot identify where is the mmdet directory. That's why my custom dataset cannot registry in the dataset.
Solution: find the mmdet packages in python site-packages and then uninstall them, reserve the git clone mmdet package
Hi all,
I followed the suggestion of @Xuebei12 and indeed solved the problem. If you install via
pip install "mmsegmentation>=1.0.0"
and then modify your source, it will not be found by your python environment even though you have followed the documentation. You need to use the Case a: If you develop and run mmseg directly, install it from source:
since you are using your own source code and do:
git clone -b main https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation
pip install -v -e .
I also had to set
export PYTHONPATH=$PYTHONPATH:/your/mmsegmentation/directory/where/you/built/it
to make sure it finds my compiled from source version of mmseg.
Cheers.
hi, I get the following error even after I have updated my
__init__.py
file and provided mycustomdataset.py
file. Here is the error.My current versions of all the packages are