Pada artikel ini dibahas usaha untuk mereplikasi solusi dari GWC_solution
Hardware yang dipakai: RTX 3090
Catatan
- RTX3090 tidak kompatibel dengan Cuda 10.2 , minimal perlu CUDA 11.3
- PyTorch 1.9.0 tidak kompatibel dengan CUDA 11.3, sehingga perlu diganti dengan PyTorch 1.10.0
- Script GWC_YOLOv5 tidak kompatibel dengan PyTorch 1.12.0
Prosedur
Create Conda environment
conda create --name gwc8 python=3.7.10 scipy=1.4.
conda activate gwc8
Install PyTorch
pip3 install torch==1.10.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
Install prerequisites
pip install -r requirements.txt
pip install numpy==1.19.5
pip uninstall -y PyYAML
pip install PyYAML==5.3.1
pip install ensemble_boxes
pip install setuptools==59.5.0
pip install jupyter
pip install matplotlib
pip install opencv-python
pip install tensorboard
Clone GWC_solution
cd /home/admin
git clone https://github.com/ksnxr/GWC_solution.git
Clone GWC_YOLOv5
cd GWC_solution
git clone https://github.com/ksnxr/GWC_YOLOv5.git
Jalankan jupyter notebook
jupyter notebook --allow-root --no-browser --ip=0.0.0.0
Setelah itu buka jupyter notebook dari browser
Eksekusi script berikut
- Use data-cleaning.ipynb to generate clean_train.csv.
- Use KFold.ipynb to generate 4-folds train and validation indexes.
- Use basis-0.ipynb, basis-1.ipynb.basis-2.ipynb and basis-3.ipynb to train on the four folds.
- Use pseudo-original-0.ipynb, pseudo-original-1.ipynb, pseudo-original-2.ipynb, pseudo-original-3.ipynb and pseudo-master-3.ipynb to train 5 pseudo models.
- Use get-labels.ipynb to ensemble the 5 weights obtained in step 3 and generate labels for subsequent training.
- Use pseudo-master-final.ipynb to train the final model.
Training
python train.py --name 4fold0 --img 800 --batch 8 --epochs 35 --data custom.yaml --weights yolov5x.pt --cache-images --save_period 1
Monitor training
cd /home/admin/GWC_solution/GWC_YOLOv5
tensorboard --logdir runs/train --bind_all
Berikut ini data flow diagram dari proses komputasi