环境:ubuntu18.04 pytorch0.4.0
-
1. 去官方给出的源码链接下载PANet
-
2. 参照Detectron.pytorch的安装步骤安装
- 2.1 Requirements
Tested under python3.
- python packages
- pytorch>=0.3.1
- torchvision>=0.2.0
- cython
- matplotlib
- numpy
- scipy
- opencv
- pyyaml
- packaging
- pycocotools — for COCO dataset, also available from pip.
- tensorboardX — for logging the losses in Tensorboard
- An NVIDAI GPU and CUDA 8.0 or higher. Some operations only have gpu implementation.
- NOTICE: different versions of Pytorch package have different memory usages.
- 2.2 Compilation
cd lib # please change to this directory
sh make.sh
然后,就可以进行测试了,运行
python tools/test_net.py --dataset coco2017 --cfg configs/panet/e2e_panet_R-50-FPN_2x_mask.yaml --load_ckpt {path/to/your/checkpoint}
load_ckpt:在官方代码页面上可以下到。
跑程序的时候遇到一点问题:
- 1. cv2.findContours报错:
ValueError: too many values to unpack
意思是说 cv2.findContours 只返回了两个值,但是你想要三个值。
cv2.findContours 只返回 contours, hierarchy,没有 image 返回。
- 2. Python下"No moudule named _tkinter"问题解决:
sudo apt-get install python3-tk