Обслуживание Tensorflow - не найдено: тип операции не зарегистрирован 'GatherTree' - PullRequest
0 голосов
/ 21 октября 2019

Я просто новичок. У меня есть проблема, когда я обслуживаю тензор потока модели в этом случае:

I. Использование этого http://opennmt.net/OpenNMT-tf/quickstart.html для обучения модели.

II. Обслуживание модели с помощью следующих шагов:

  1. Создание образа докера с помощью:

docker build --pull -t $USER/tensorflow-serving-devel -f tensorflow_serving/tools/docker/Dockerfile.devel .

Запуск док-контейнера:

docker run --name=tf_container -it $USER/tensorflow-serving-devel

Обслуживание модели:

tensorflow_model_server --port=9000 --model_name=model_name --model_base_path=/model_file &> result_log &

III. result_log содержимое файла:

2019-10-21 02:46:12.840258: I tensorflow_serving/core/loader_harness.cc:155] Encountered an error for servable version {name: ente version: 1569320347}: Not found: Op type not registered 'GatherTree' in binary running on 1b79e5fb3ac4. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
2019-10-21 02:46:12.840280: E tensorflow_serving/core/aspired_versions_manager.cc:359] Servable {name: ente version: 1569320347} cannot be loaded: Not found: Op type not registered 'GatherTree' in binary running on 1b79e5fb3ac4. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
2019-10-21 02:46:13.664569: I tensorflow_serving/core/basic_manager.cc:280] Unload all remaining servables in the manager.
Failed to start server. Error: Unknown: 1 servable(s) did not become available: {{{name: ente version: 1569320347} due to error: Not found: Op type not registered 'GatherTree' in binary running on 1b79e5fb3ac4. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.}, } ```

I have searched Google and try to update some services, but the problem still here. Anyone have any idea please?

Thanks so much for any suggestions!



1 Ответ

0 голосов
/ 22 октября 2019

С переходом на TensorFlow 2.0 операция GatherTree, используемая в поиске лучей, в настоящее время недоступна в TensorFlow Serving.

  • Если вы обучили свою модель с OpenNMT-tf 1.x, он использует GatherTree из tf.contrib, который был удален в последних версиях TensorFlow Serving. Вам следует использовать предыдущую версию TensorFlow Serving, такую ​​как 1.15.0.
  • Если вы обучали свою модель с OpenNMT-tf 2.x, она использует GatherTree из TensorFlow Addons , которая являетсяв настоящее время не интегрировано в обслуживание TensorFlow. Это работа в процессе . В настоящее время существует 2 обходных пути:
    • использование opennmt/tensorflow-serving:2.0.0, которое представляет собой пользовательскую сборку обслуживания, включающую эту опцию.
    • отключение поиска луча в OpenNMT-tf с этой конфигурацией:
params:
  beam_width: 1
...