cocodataset / cocoapi

COCO API - Dataset @ http://cocodataset.org/
Other
6.07k stars 3.75k forks source link

Cocoapi fails to install in Windows #311

Open smartdevices2ai opened 5 years ago

smartdevices2ai commented 5 years ago

Please help me to solve these issues:- After running below command:-

python model_main.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_thali.config

I am getting Error message:-

from object_detection.metrics import coco_tools File "C:\ProgramData\Anaconda3\envs\venv_obj_gpu2\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\metrics\coco_tools.py", line 51, in from pycocotools import coco ModuleNotFoundError: No module named 'pycocotools'

To solve this I put pycocotools folder in object_detection directory then this error was gone but new error came _mask file not found

To solve this I thought of run a command : I copied PythonAPI in model/research/ from official cocoapi folder PWD: model/research

python PythonAPI/setup.py build_ext install

then I got different error: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64/link.exe not found. but file is there.

I am using python 3.6 on Windows 10 with Tensorflow gpu 1.12 as per the official doc is provided we need to put pycocotools folder into research directory of Model but not working.

Please suggest me any way to overcome this.

mads5 commented 4 years ago

search pycocotools on google and open first kaggle link... download vs c++ build tools from there and install ... then try installing pycocotools...

This worked for me!!

virafpatrawala commented 4 years ago

If you are working in Conda, you can follow the below steps to be able to install, import and use this library quite smoothly.

### Enter the below in your Conda Command Prompt ###
# Create a new environment
conda create -n <envName>
# Activate the environment
conda activate <envName>
# Install cython
pip install cython
# Install git
conda install -c anaconda git
# Install pycocotools from this GitHub rep
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI

Additionally, I have recently written an entire post on exploring and manipulating the COCO dataset. Do have a look.