solov2训练报错
前言
一、solov2在adelaidet上训练
Train Your Own Models
To train a model with “train_net.py”, first
setup the corresponding datasets following
datasets/README.md,
then run:
OMP_NUM_THREADS=1 python tools/train_net.py \
--config-file configs/FCOS-Detection/R_50_1x.yaml \
--num-gpus 8 \
OUTPUT_DIR training_dir/fcos_R_50_1x
To evaluate the model after training, run:
OMP_NUM_THREADS=1 python tools/train_net.py \
--config-file configs/FCOS-Detection/R_50_1x.yaml \
--eval-only \
--num-gpus 8 \
OUTPUT_DIR training_dir/fcos_R_50_1x \
MODEL.WEIGHTS training_dir/fcos_R_50_1x/model_final.pth
二、报错记录
1.cannot import name ‘string_metric’ from ‘rapidfuzz’
解决方法:
rapidfuzz版本过高
pip install rapidfuzz==1.1.1
2.return _mask.decode([rleObjs])[:,:,0]
TypeError: ‘NoneType’ object is not subscriptable
检查代码后,发现pycocotools未正确安装。
解决方法:
卸载重新安装pycocotools ,下载链接
cd PythonAPI #进入setup.py文件目录
python setup.py build_ext --inplace
python setup.py build_ext install
报错:: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the ‘trunc’ function NOT ‘floor’).
原因:gpuRAM太小(本机电脑4g,完全不够用),或者batchsize太大。
解决方法:
使用用服务器训练。