Ошибка компиляции библиотек Protobuf при установке API обнаружения объектов Ubuntu - PullRequest
0 голосов
/ 16 февраля 2019

У меня возникла ошибка при установке api обнаружения объекта, и я попытался использовать приведенное ниже решение из этой темы https://github.com/tensorflow/models/issues/1570.

mkdir -p ~/installs/protoc_3.3.0
    cd ~/installs/protoc_3.3.0
    wget https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip
    chmod 775 protoc-3.3.0-linux-x86_64.zip
    unzip protoc-3.3.0-linux-x86_64.zip

Затем:

    cd ~/git/models/
    ~/installs/protoc_3.3.0/bin/protoc object_detection/protos/*.proto --python_out=.
    python setup.py install --prefix=~

, но я получилошибка ниже для последней строки кода выше.

python setup.py install --prefix=~
running install
Checking .pth file support in /home/ayshine/lib/python3.7/site-packages/
/home/ayshine/anaconda3/bin/python -E -c pass
TEST FAILED: /home/ayshine/lib/python3.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH

You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /home/ayshine/lib/python3.7/site-packages/

and your PYTHONPATH environment variable currently contains:

    ''

Here are some of your options for correcting the problem:

* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files

* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)

* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:

  https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations


Please make the appropriate changes for your system and try again.

1 Ответ

0 голосов
/ 19 февраля 2019

Установка protobuf, описанная как на этом посте, решает мою проблему.https://pythonprogramming.net/introduction-use-tensorflow-object-detection-api-tutorial/

...