安装Mask R-CNN出现 module 'setuptools.dist' has no attribute 'check_specifier'错误的解决方法

当运行

python3 setup.py install

出现如下错误:

File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2237, in resolve
AttributeError: module 'setuptools.dist' has no attribute 'check_specifier'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 67, in 
    keywords="image instance segmentation object detection mask rcnn r-cnn tensorflow keras",
  File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/share/python-wheels/setuptools-20.7.0-py2.py3-none-any.whl/setuptools/dist.py", line 272, in __init__
  File "/usr/lib/python3.5/distutils/dist.py", line 281, in __init__
    self.finalize_options()
  File "/usr/share/python-wheels/setuptools-20.7.0-py2.py3-none-any.whl/setuptools/dist.py", line 327, in finalize_options
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2229, in load
  File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 2239, in resolve
ImportError: module 'setuptools.dist' has no attribute 'check_specifier'

更新setuptools是解决不了问题的,正确的解决方法:

pip install --upgrade pip
hash -r pip
pip3 install --upgrade pip
hash -r pip3
cd (Mask RCNN root folder)
sudo python3 setup.py install

参考:https://github.com/matterport/Mask_RCNN/issues/612

你可能感兴趣的:(深度学习,Mask,R-CNN)