Mask R-CNN tensorflow CPU版本配置 问题&解决方案

问题1:python-dev无法安装
用aptitude 工具可以两步搞定,
sudo apt-get install aptitude
sudo aptitude install python-dev

问题2:缺少Cython.build模块
使用pip install Cython即可

问题3:在shell, /libs/datasets/pycocotools目录中 输入make指令出现字符编码问题ascii
site.py,找到setencoding()方法:
def setencoding():
"""Set the string encoding used by the Unicode implementation. The
default is 'ascii', but if you're willing to experiment, you can
change this."""
encoding = "ascii" # Default value set by _PyUnicode_Init()
代码注释表明:默认的字符编码是‘ascii’,但是你可以更改这个。
于是把:encoding 变量值改成了:GBK

问题4:在pycharm ide中无法make

在终端中执行即可(没搞清楚原因,可能是pycharm的引入包问题)


问题5:在终端中/libs中 make报错 cuda路径问题

将setup.py文件的GPU部分注释掉 即可


问题6:no module named cv2
pip install opencv-python

问题7:无GPU版本配置
修改libs下的setup.py文件将gpu部分注释
修改libs/boxes下的nms_wrappers.py注释掉GPU包的引入
以及
def nms(dets, thresh, force_cpu=False):
    """Dispatch to either CPU or GPU NMS implementations."""

    if dets.shape[0] == 0:
        return []
    #return gpu_nms.gpu_nms(dets, thresh, device_id=0)
    else:
        return cpu_nms.cpu_nms(dets, thresh)

猜你喜欢

转载自blog.csdn.net/sinat_29447759/article/details/79517887