tensorflow / tensorflow/java

Use of tensorflow_decision_forests

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

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

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

説明

Hi,

Firstly, thank you for your great work making the tensorflow library accessible within the java ecosystem.

I would like some guidance or info about how to incorporate a third party library tensorflow_decision_forests (https://www.tensorflow.org/decision_forests) into tensorflow-java. Particularly, I would like to take a trained model and run inference with it from a java app.

I've given this a number of tries on my own. I am using the 0.5.0-SNAPSHOT that targets tf 2.9.1 along with the version of tfdf version 0.2.7 which also targets tf 2.9.1. Without any modifications tensorflow-java or library loading, the error that arises is this:

2022-12-06 08:16:16.811242: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:301] SavedModel load for tags { serve }; Status: fail: NOT_FOUND: Op type not registered 'SimpleMLCreateModelResource' in binary running on localhost. 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.. Took 16415 microseconds.

This is the obvious error as I'm aware the library introduces custom tensorflow operations which are probably needed to run inference on the saved model. I attempted to raid the shared library .so files from the library distribution and load them using Tensorflow.loadLibrary from within docker containers, but this did not work for me:

TensorFlow.loadLibrary("/usr/local/anaconda3/lib/python3.8/site-packages/tensorflow_decision_forests/tensorflow/ops/inference/inference.so");
TensorFlow.loadLibrary("/usr/local/anaconda3/lib/python3.8/site-packages/tensorflow_decision_forests/tensorflow/ops/training/training.so");

I'm a little out of my depth as to how to get this to work properly, and I would appreciate any helpful info, resources or direction.

I note that the most similar looking issue recently was https://github.com/tensorflow/java/pull/468 -- which also involves loading shared libraries for a 3rd party library.

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

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

はじめの一歩

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

調査の方向性

TensorFlow.loadLibrary と、issue に示されている tensorflow_decision_forests の inference.so および training.so のパスから始めます。同様の共有ライブラリ統合については tensorflow/java#468 を読み、その後、Java から TFDF SavedModel を読み込むためにサポートされている手順を確認し、検証済みの推論パスまたは不足している統合作業を文書化します。

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

評価

技術スタック
java
領域
machine-learning
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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