You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import org.tensorflow.SavedModelBundle;
public class App {
public static void main(String[] args) {
SavedModelBundle.load("s3://some/location", "serve");
}
}
Environment variable: AWS_REGION=eu-central-1
Outcome:
2022-03-09 20:53:24.893857: I external/org_tensorflow/tensorflow/cc/saved_model/reader.cc:43] Reading SavedModel from: s3://some/location
2022-03-09 20:53:24.893896: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:283] SavedModel load for tags { serve }; Status: fail: NOT_FOUND: Could not find SavedModel .pb or .pbtxt at supplied export directory path: s3://some/location. Took 49 microseconds.
Exception in thread "main" org.tensorflow.exceptions.TensorFlowException: Could not find SavedModel .pb or .pbtxt at supplied export directory path: s3://some/location
at org.tensorflow.internal.c_api.AbstractTF_Status.throwExceptionIfNotOK(AbstractTF_Status.java:101)
at org.tensorflow.SavedModelBundle.load(SavedModelBundle.java:623)
at org.tensorflow.SavedModelBundle.access$000(SavedModelBundle.java:67)
at org.tensorflow.SavedModelBundle$Loader.load(SavedModelBundle.java:97)
at org.tensorflow.SavedModelBundle.load(SavedModelBundle.java:357)
at App.main(App.java:6)
Either of the changes below "fixes" the issue:
changing from S3 to local
changing from 0.4.0 to 0.3.3
Question: has anything changed since the previous version? Are we missing some important point that would make integration with S3 possible?
s3 support was removed from TF 2.6 (tensorflow/tensorflow#51583) and split out into a separate TF IO package (https://github.com/tensorflow/io). If you download the appropriate version of TF IO, extract the so/dylib files from it, you should be able to register the filesystem plugin with org.tensorflow.internal.c_api.global.tensorflow.TF_RegisterFilesystemPlugin(String plugin_filename, TF_Status status). We don't provide a wrapper around that method like we do for library loading, because we hadn't noticed that upstream TF had split out the filesystem support into a separate package. We'll put it on the todo list.
Hi @Craigacp and @dennisTS, I have the same problem. Could you mind to share the solution? Since I have downloaded the newest version of TF IO and installed it correctly, but I still found that issue?
You need to supply the path to libtensorflow_io_plugins.so which will have been installed into your python environment as an argument to the TF_RegisterFilesystemPlugin method that I mentioned above.
In v0.4.2 we added a method which makes it easier to load the native filesystem libraries. You'll still need to download the python wheel and extract it, but at least it's easier to load on the Java side now.
Activity
Craigacp commentedon Mar 9, 2022
s3 support was removed from TF 2.6 (tensorflow/tensorflow#51583) and split out into a separate TF IO package (https://github.com/tensorflow/io). If you download the appropriate version of TF IO, extract the so/dylib files from it, you should be able to register the filesystem plugin with
org.tensorflow.internal.c_api.global.tensorflow.TF_RegisterFilesystemPlugin(String plugin_filename, TF_Status status). We don't provide a wrapper around that method like we do for library loading, because we hadn't noticed that upstream TF had split out the filesystem support into a separate package. We'll put it on the todo list.dennisTS commentedon Mar 10, 2022
Understood, thanks for the clarification, @Craigacp !
rhps commentedon Mar 16, 2022
Hi @Craigacp and @dennisTS, I have the same problem. Could you mind to share the solution? Since I have downloaded the newest version of TF IO and installed it correctly, but I still found that issue?
Craigacp commentedon Mar 16, 2022
You need to supply the path to
libtensorflow_io_plugins.sowhich will have been installed into your python environment as an argument to theTF_RegisterFilesystemPluginmethod that I mentioned above.Craigacp commentedon Sep 23, 2022
In v0.4.2 we added a method which makes it easier to load the native filesystem libraries. You'll still need to download the python wheel and extract it, but at least it's easier to load on the Java side now.