Code reproduction: remote sensing rotating target detection (you can train your own data set)

Followed the two methods submitted by Dr. Yangxue. This article only records the problems encountered during the reproduction process. I will not write the introduction of the specific thesis. The master’s own knowledge has been written in great detail.

SCRDet: https://zhuanlan.zhihu.com/p/107400817

CSL: https://zhuanlan.zhihu.com/p/111493759

The first method to reproduce: https://github.com/DetectionTeamUCAS/R2CNN-Plus-Plus_Tensorflow

Under Ubuntu16.04

1、tensorflow >= 1.2
2、cuda8.0
3、python2.7 (anaconda2 recommend)
4、opencv(cv2)
5、tfplot

The measured tensorflow-gpu==1.2 and 1.4 can be used, cuda8 needs to be compiled and installed locally, and python2.7 environment can be created under anaconda3

When actually installing tf, conda could not directly install such a low version of tensorflow-gpu, so it downloaded the wheel from pypi and installed it locally, and some other dependent packages would be installed automatically.

pip install tensorflow_gpu-1.4.0-cp27-cp27mu-manylinux1_x86_64.wheel

Another thing to note is that this version of tf is equipped with numpy 1.16.3. When installing opencv, you mainly need to control the version. Otherwise, an error will be reported if the numpy version is not correct. After trying, opencv-python installs 3.3.1.11.

pip install opencv-python==3.3.1.11

Cuda8 needs to be compiled locally, install cudatoolikit8 in the conda environment and report an error in subsequent compilations. In addition, a cudnn is required in the conda virtual environment to import tensorflow normally.

conda install cudnn==5.1.10

In fact, the installation of cython does not need to strictly control the version. To be safe, it corresponds to the file in the folder. Cython chooses 0.25.2

There is also a tfplot that needs to be installed, directly pip

conda install cython==0.25.2

pip install tensorflow-plot

Finally, in accordance with the author’s process, put the pre-training weights in the corresponding folder, and gave it to Baidu Cloud intimately, thank you

Training your own data set is also very simple. If the annotation of the data set is txt and is [x1,y1,x2,y2,x3,y3,x4,y4,class,more], there are The direct tool can be txt2xml.py. After converting to xml, tfrecord can be generated according to the author's steps. The steps in github are very detailed.

After preparing the data, follow the prompts of github and modify the configuration in several files to start training.

Another method CSL https://github.com/Thinklab-SJTU/CSL_RetinaNet_Tensorflow configuration is very simple

conda create -n xxx python=3.6
conda activate xxx
conda install tensorflow-gpu=1.13.1
conda install cudatoolkit==10.0
conda install cudnn==7.6.5
pip install opencv-python
pip install tensorflow-plot

Training your own data set is very similar to the previous method, this supports multiple GPUs.

Guess you like

Origin blog.csdn.net/hesongzefairy/article/details/109162527