Mask RCNN教學的YOUTUBE在https://www.youtube.com/watch?v=2TikTv6PWDw

在試驗網路上的教學時, 在安裝步驟這裡卡住了

當我輸入pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

發生了這樣的錯誤

未命名.png

Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
  Cloning https://github.com/philferriere/cocoapi.git to c:\users\user\appdata\local\temp\pip-req-build-gvk8gtp3
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (setup.py) ... error
  Complete output from command D:\ProgramData\Anaconda3\envs\MASKRCNN\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-req-build-gvk8gtp3\\PythonAPI\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\USER\AppData\Local\Temp\pip-wheel-sv7fhtk1 --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools
  running build_ext
  building 'pycocotools._mask' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

  ----------------------------------------
  Failed building wheel for pycocotools
  Running setup.py clean for pycocotools
  Complete output from command D:\ProgramData\Anaconda3\envs\MASKRCNN\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-req-build-gvk8gtp3\\PythonAPI\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\USER\AppData\Local\Temp\pip-req-build-gvk8gtp3\PythonAPI\setup.py", line 25, in <module>
      cythonize(ext_modules)
    File "D:\ProgramData\Anaconda3\envs\MASKRCNN\lib\site-packages\Cython\Build\Dependencies.py", line 967, in cythonize
      aliases=aliases)
    File "D:\ProgramData\Anaconda3\envs\MASKRCNN\lib\site-packages\Cython\Build\Dependencies.py", line 812, in create_extension_list
      for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
    File "D:\ProgramData\Anaconda3\envs\MASKRCNN\lib\site-packages\Cython\Build\Dependencies.py", line 111, in nonempty
      raise ValueError(error_msg)
  ValueError: 'pycocotools/_mask.pyx' doesn't match any files

  ----------------------------------------
  Failed cleaning build dir for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools                                                                                Running setup.py install for pycocotools ... error                                                                        Complete output from command D:\ProgramData\Anaconda3\envs\MASKRCNN\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-req-build-gvk8gtp3\\PythonAPI\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\USER\AppData\Local\Temp\pip-record-j9ndioa3\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py                                                                                                        running build_ext
    building 'pycocotools._mask' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

    ----------------------------------------                                                                            Command "D:\ProgramData\Anaconda3\envs\MASKRCNN\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-req-build-gvk8gtp3\\PythonAPI\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\USER\AppData\Local\Temp\pip-record-j9ndioa3\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-req-build-gvk8gtp3\PythonAPI

大概就是這一串....................

網路上的文章說原因出在Pycocotools不支持Windows......

還好最後解決了, 方法在下面的連結

https://github.com/philferriere/cocoapi

首先下載 Visual C++ 2015 build tools 並且安裝

https://go.microsoft.com/fwlink/?LinkId=691126

接著輸入pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

未命名.png

恩...這次沒有卡很久

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

arrow
arrow
    文章標籤
    mask rcnn Pycocotools
    全站熱搜

    張郎屋 發表在 痞客邦 留言(2) 人氣()