tensorflow / tensorflow/java

Unary VariantDecodeFn for type_name: tensorflow::data::WrappedDatasetVariant already registered

オープン
#226 コメント 20 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
928
フォーク
227
PR マージ指標
30日以内にマージされた PR はありません

説明

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Debian GNU/Linux 9.13 (stretch) (inside Docker container)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): TensorFlow 2.3.1 and tensorflow-java 0.2.0
  • Python version: 3.6.13
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

You can collect some of this information using our environment capture script
You can also obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the current behavior

I executed Python TensorFlow v2.3.1 and TensorFlow java invoked from JNI by using pyjnius in a Python process. Then, the following error was shown and the Python process was aborted.

2021-02-25 07:57:21.005274: F external/org_tensorflow/tensorflow/core/framework/variant_op_registry.cc:46] Check failed: existing == nullptr (0x56489dc7a258 vs. nullptr)Unary VariantDecodeFn for type_name: tensorflow::data::WrappedDatasetVariant already registered
Aborted

More details:

  1. I prepared a TensorFlow model pre-trained Python TensorFlow. The model is stored in a .pb file.
  2. I executed a Python process, which contains:
    1. import neseccary python libraries such as tensorflow and pyjnius.
    2. invoke JNI by using pyjnius which loads the stored model by using SavedModelBundle.load().
  3. The step 2.2 raised the error described above.

Describe the expected behavior

The user should be able to execute both (python and java) from a Python process without any conflict exceptions.

Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

I pushed a sample code into https://github.com/akiou/tf_conflict. You can reproduce this error by using the repo sample code.

Other info / 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.

The error message is dependeing on the platform OS. The error message in this issue is observed inside a Linux docker container. If you run the sample code in Mac OS, then the following error message is shown instead:

2021-02-25 17:32:28.532107: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/core/eager_context_created
2021-02-25 17:32:28.532275: F tensorflow/core/framework/op.cc:62] Non-OK-status: RegisterAlreadyLocked(op_data_factory) status: Already exists: Op with name XlaLaunch
[1]    70088 abort      python test/conflict.py

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンクされている tf_conflict サンプルと test/conflict.py から始め、Python TensorFlow が pyjnius 経由で tensorflow-java をロードして SavedModelBundle.load() を呼び出したときの失敗を再現します。その構成で発生する重複登録エラーを追跡します。完了条件は、Python TensorFlow と Java TensorFlow を同一プロセス内で、異常終了や登録の競合なしに実行できることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, python
領域
backend, machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。