赞
踩
安装好maskrcnn镜像后
#安装pytorch的FCOS
git clone https://github.com/tianzhi0549/FCOS.git
cd FCOS
python setup.py build develop --no-deps
#下载预训练模型到FCOS文件夹,地址在https://github.com/tianzhi0549/FCOS Models
wget +url
#运行demo
Python demo/fcos_demo.py
#推理命令
python -m torch.distributed.launch
–nproc_per_node=2
–master_port=$((RANDOM + 10000))
tools/test_net.py
–config-file configs/fcos/fcos_imprv_R_50_FPN_1x.yaml
MODEL.WEIGHT fcos_imprv_R_50_FPN_1x.pth
TEST.IMS_PER_BATCH 2
#训练命令
python -m torch.distributed.launch
–nproc_per_node=2
–master_port=$((RANDOM + 10000))
tools/train_net.py
–config-file configs/fcos/fcos_imprv_R_50_FPN_1x.yaml
DATALOADER.NUM_WORKERS 2
OUTPUT_DIR training_dir/fcos_imprv_R_50_FPN_1x
*可在config-file修改数据集路径
*pytorch版本为1.1.0 py3.6_cuda9.0.176_cudnn7.5.1_0
可能会出现的问题:
1.ImportError: libGL.so.1: cannot open shared object file: No such file or directory
解决方法:
apt-get update
apt-get install sudo
sudo apt update
sudo apt install libgl1-mesa-glx
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
原因:numpy版本过低
解决方法:
pip install --upgrade numpy
如果还不行,则需要卸载旧numpy后,重装。
cv2.error: OpenCV(4.5.5)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。