tensorflow / models

Models and examples built with TensorFlow
Other
77.16k stars 45.75k forks source link

Inconsistent models/official/requirements.txt? #7662

Closed artemry-nv closed 3 years ago

artemry-nv commented 5 years ago

System information

Describe the problem

Trying to install the requirements on an Ubuntu system but get an error:

$ git clone --depth 1 https://github.com/tensorflow/models.git && \ pip install -r models/official/requirements.txt ... Obtaining pycocotools from git+https://github.com/cocodataset/cocoapi#egg=pycocotools&subdirectory=PythonAPI (from -r models/official/requirements.txt (line 18)) Cloning https://github.com/cocodataset/cocoapi to ./src/pycocotools  Running command git clone -q https://github.com/cocodataset/cocoapi /examples/src/pycocotools  ERROR: Command errored out with exit status 1: command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/examples/src/pycocotools/PythonAPI/setup.py'"'"'; file='"'"'/examples/src/pycocotools/PythonAPI/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info cwd: /examples/src/pycocotools/PythonAPI Complete output (5 lines): Traceback (most recent call last): File "", line 1, in File "/examples/src/pycocotools/PythonAPI/setup.py", line 2, in import numpy as np ImportError: No module named numpy

W/A: install numpy in advance.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

saberkun commented 5 years ago

Hi itemko, Sorry, for our testing, we always install TF first which will use numpy. We can add numpy to the dependency. Would you like to send a PR? Thanks!

@yeqingli , + Yeqing, could you verify this?

yeqingli commented 5 years ago

Hi itemko,

Thanks for the sending this. I have reproduced on my side. This issue is because the pip doesn't install the packages in the order of requirements. I will send out a fix.

yeqingli commented 5 years ago

An easy fix would be first install a Tensorflow library first and then run the pip install the requirements. Because the TF will install numpy first, it should fix the problem.

google-ml-butler[bot] commented 3 years ago

Are you satisfied with the resolution of your issue? Yes No