項目地址:https://github.com/shaoshengsong/MobileNetV3-SSD
需要注意的幾個問題:
1.在測試一張圖片的時候會報錯:
expected backend CPU and dtype Float but got backend CUDA and dtype Float
解決方法:
If you are trying to use GPU, change device in create_mobilenetv3_ssd_lite_predictor to torch.device('cuda:0'), it works for me.
2.首次訓練時:
如果--dataset_type選擇open_images則需要事先運行
python open_images_downloader.py --root ~/data/open_images --class_names "Handgun,Shotgun" --num_workers 20進行下載.
默認使用的是VOC模式,所以如果下載VOC數據集訓練則:
python train_ssd.py --datasets ~/data/VOC2007/ --validation_dataset ~/data/VOC2007/ --net mb1-ssd
--net mb3-ssd-lite --scheduler cosine --lr 0.01 --t_max 100 --validation_epochs 5 --num_epochs 100 --base_net_lr 0.001 --batch_size 5
一定要加--validation_dataset 由於我只下載了VOC2007 所以驗證集也用了VOC2007 注意在 VOC2007/imageSets/Main/下新建test.txt不然會找不到
更多細節參考:https://github.com/qfgaohao/pytorch-ssd
運行python run_ssd_example.py報錯:expected device cpu but got device cuda:0
解決:https://github.com/shaoshengsong/MobileNetV3-SSD/issues/5
