mmrotate
mmrotate copied to clipboard
[Bug] Running test.py reported an error: list index out of range
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] I have read the FAQ documentation but cannot get the expected help.
- [X] The bug has not been fixed in the latest version (master) or latest version (1.x).
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmrotate
Environment
E:\Anaconda\envs\MMdetec\lib\site-packages\mmcv_init_.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training pr ocess and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/do cs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' fatal: not a git repository (or any of the parent directories): .git sys.platform: win32 Python: 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 05:35:01) [MSC v.1916 64 bit (AMD64)] CUDA available: True GPU 0: NVIDIA GeForce RTX 3060 Laptop GPU CUDA_HOME: E:\cuda\NVIDIA GPU Computing Toolkit\CUDA NVCC: Cuda compilation tools, release 11.6, V11.6.55 MSVC: Microsoft (R) C/C++Optimization Compiler Version 19.35.32216.1 for x64 GCC: n/a PyTorch: 1.7.1+cu110 PyTorch compiling details: PyTorch built with:
- C++ Version: 199711
- MSVC 192729112
- Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191125 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
- OpenMP 2019
- CPU capability usage: AVX2
- CUDA Runtime 11.0
- NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;ar ch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_37,code=compute_37
- CuDNN 8.0.4
- Magma 2.5.4
- Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj -openmp:experimental -DNDEBUG -DUSE_FBGEMM -DUSE_VULKAN_WRAPPER, PERF_WITH_AVX=1, PE RF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON,
TorchVision: 0.8.2+cu110 OpenCV: 4.7.0 MMCV: 1.7.1 MMCV Compiler: MSVC 193532216 MMCV CUDA Compiler: 11.6 MMRotate: 0.3.4+
Reproduces the problem - code sample
Using a custom dataset, the corresponding parameters such as category and num_classes have been modified. The model training is normal and successful, but running test.py will result in an error. Please help me solve it, thank you!
Reproduces the problem - command or script
python tools/test.py Oriented_RepPoints/oriented_reppoints_r50_fpn_1x_dota_le135.py Oriented_RepPoints/epoch_150.pth --out Oriented_RepPoints/latest.pkl --eval mAP
Reproduces the problem - error message
E:\Anaconda\envs\MMdetec\lib\site-packages\mmcv_init_.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training pr ocess and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/do cs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' f:\mmrotate-main\mmrotate\utils\setup_env.py:39: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, p lease further tune the variable for optimal performance in your application as needed. f'Setting OMP_NUM_THREADS environment variable for each process ' f:\mmrotate-main\mmrotate\utils\setup_env.py:49: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, p lease further tune the variable for optimal performance in your application as needed. f'Setting MKL_NUM_THREADS environment variable for each process ' load checkpoint from local path: Oriented_RepPoints/epoch_150.pth completed: 0, elapsed: 0sE:\Anaconda\envs\MMdetec\lib\site-packages\mmcv_init_.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components r elated to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open- mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' E:\Anaconda\envs\MMdetec\lib\site-packages\mmcv_init_.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training pr ocess and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/do cs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove '
writing results to Oriented_RepPoints/latest.pkl
Traceback (most recent call last):
File "tools/test.py", line 263, in
Additional information
I want to successfully run test.py. The previous issue mentioned similar bugs, but it was not helpful to me because I was able to successfully train the model and I am not sure how the bugs were generated.
I have the same problem. After repeated debugging, I just noticed that all the txt files in the split_ms_dota/test/annfiles folder were actually empty. This issue can occur if you follow the dataset tutorial in this page (https://github.com/open-mmlab/mmrotate/blob/main/tools/data/dota/README.md).
I don't know the solution yet. Please let me know if you know how.
/test 的 annfiles 肯定是空的,这个不是用来推断的吗? 你看是否你是用的其它数据,种类写的不对,应该还是配置文件的原因。
我也有同样的问题。经过反复调试,我才发现split_ms_dota/test/annfiles文件夹中的所有txt文件实际上都是空的。 如果您遵循本页面中的数据集教程 ( https://github.com/open-mmlab/mmrotate/blob/main/tools/data/dota/README.md ),则可能会出现此问题。
我还不知道解决办法。如果您知道如何操作,请告诉我。
yes,i also want to know how to calculate the mAP on the test set. There are only pictures in the test set without labels, but a lot of papers say test on the test set, how does that work?
If you are using the DOTA data set, you can use the following method.On the contrary, if it is another data set that has been labeled, you can split the data set into a training set and a test set, and use the code (python tools/data/dota/split/img_split.py --base-json \ tools/data/dota/split/split_configs/ss_trainval.json) to split, and then use the offline solution.
You can use the code in picture 1 to generate a file similar to example_Task1.zip. (The code is also available through the official documentation (link 1)).
Then, follow link 2 to submit.
https://mmrotate.readthedocs.io/en/latest/get_started.html#test-a-model
https://captain-whu.github.io/DOTA/evaluation.html
我也有同样的问题。经过反复调试,我才发现split_ms_dota/test/annfiles文件夹中的所有txt文件实际上都是空的。 如果您遵循本页面中的数据集教程 ( https://github.com/open-mmlab/mmrotate/blob/main/tools/data/dota/README.md ),则可能会出现此问题。 我还不知道解决办法。如果您知道如何操作,请告诉我。
yes,i also want to know how to calculate the mAP on the test set. There are only pictures in the test set without labels, but a lot of papers say test on the test set, how does that work?