Ошибка обслуживания TensorFlow

Я установил Tensorflow Serving, как указано на странице установки по адресу https://tensorflow.github.io/serving/setup. Однако когда я следую инструкциям по сборке на странице, я получаю следующую ошибку:

$ bazel build tensorflow_serving/...

ERROR: /home/**PATH**/external/org_tensorflow/third_party/py/python_configure.bzl:183:20: unexpected keyword 'environ' in call to repository_rule(implementation: function, *, attrs: dict or NoneType = None, local: bool = False).
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'third_party/py/python_configure.bzl' has errors.
INFO: Elapsed time: 0.623s

Я использую сборку Ubuntu и TensorFlow 1.0.1. Я использую Python 2.7 и настроил файл virtualenv.

Я могу успешно создать пример bazel hello, а также выполнить быстрое начало работы с gRPC, которое можно найти по адресу http://www.grpc.io/docs/quickstart/python.html.

Какие-либо предложения?

-Дэйв


person David Herman    schedule 01.05.2017    source источник


Ответы (1)


Беда была в старой копии базеля. Чтобы определить вашу версию

$ bazel version
Build label: 0.4.5
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Mar 16 12:19:38 2017 (1489666778)
Build timestamp: 1489666778
Build timestamp as int: 1489666778

В моем случае требовалось ручное удаление старой версии

rm -fr ~/.bazel ~/.bazelrc

Далее я выбрал установку с помощью установщика для ubuntu.

$ ./bazel-0.4.5-installer-linux-x86_64.sh
Bazel installer
---------------

Bazel is bundled with software licensed under the GPLv2 with Classpath exception.
You can find the sources next to the installer on our release page:
   https://github.com/bazelbuild/bazel/releases

# Release 0.4.5 (2017-03-16)

Была еще одна хитрость, чтобы заставить его работать.

$cd ..
$ bazel test tensorflow_serving/...
Python Configuration Error: 'PYTHON_BIN_PATH' environment variable is not set

Эта ошибка также связана с управлением версиями, но в данном случае это была проблема с обслуживанием. Решением было вернуться к более ранней версии и обновить подмодуль из git (ранее я клонировал репозиторий). Из обслуживающего каталога:

$ git checkout 0.5.1
M   tensorflow
M   tf_models
Note: checking out '0.5.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 51bb356... Merge pull request #325 from kirilg/0.5.1
(tensorflow) $ git submodule update
Submodule path 'tensorflow': checked out '07bb8ea2379bd459832b23951fb20ec47f3fdbd4'
Submodule path 'tf_models': checked out '2fd3dcf3f31707820126a4d9ce595e6a1547385d'
(tensorflow) $ bazel test tensorflow_serving/...

Обслуживание сейчас сообщает об успехе:

INFO: Found 199 targets and 57 test targets...
[1,299 / 4,037] Still waiting for 200 jobs to complete:
      Running (standalone):
person David Herman    schedule 02.05.2017