- Python >= 3.7
conda create -n training python=3.7
conda activate training
pip install -r requirement.txt
docker build -t opencv_training .
docker run -it --shm-size=32GB \
--gpus=all \
-v `pwd`/out_snapshot:/workspace/out_snapshot \
-v `pwd`/dataset:/workspace/dataset \
--name opencv_training opencv_training:latest
python train.py --network resnet18 --num_classes 2 --input_size 224 --epochs 20 --learning_rate 0.0005 --batch_size 64 --dataset dataset/mvtec --path_pretrain pretrains/resnet18-5c106cde.pth --job_name obj_classify
python export_onnx.py --network resnet18 --num_classes 2 --input_size 224 --path_model out_snapshot/resnet18/resnet18_best_model.pth