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
Copy file name to clipboardExpand all lines: MIGRATING.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
# Migrating Between TensorFlow Java Releases
2
2
3
-
TensorFlow Java is still in an alpha stage, therefore is subject to contain breaking changes between the different releases. This guide explain in detail
4
-
how to migrate your code from a previous version to a new one that includes some changes that are not backward compatible.
3
+
This guide explains in detail how to migrate your code from a pre-1.0 release to a 1.0 or newer release. Post 1.0
4
+
releases have API stability as much as possible, though upstream TensorFlow does remove ops from time to time and
5
+
consequently those ops will be removed from TensorFlow-Java
Only one dependency can be added per platform, meaning that you cannot add native dependencies to both `linux-x86_64` and
@@ -135,20 +136,20 @@ For Ubuntu 24.04, you can install them with the following command:
135
136
In some cases, it might be preferable to add a single dependency that includes transitively all the artifacts
136
137
required to run TensorFlow Java on any [supported platforms](README.md#individual-dependencies)
137
138
138
-
-`tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `linux-x86_64-arm64`, `macosx-arm64`and `windows-x86_64`
139
+
-`tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `linux-arm64`, and `macosx-arm64`
139
140
140
141
For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can
TensorFlow-Java is built on top of the native TensorFlow library, and uses [JavaCPP](https://github.com/bytedeco/javacpp)
203
+
to call that library which in turn uses the Java Native Interface (JNI). In [Java 24 and newer](https://openjdk.org/jeps/472)
204
+
uses of JNI trigger a warning of the form:
205
+
```
206
+
WARNING: A restricted method in java.lang.System has been called
207
+
WARNING: java.lang.System::loadLibrary has been called by org.bytedeco.javacpp.Loader in an unnamed module (file:/.../.m2/repository/org/bytedeco/javacpp/1.5.12/javacpp-1.5.12.jar)
208
+
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
209
+
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
210
+
```
211
+
This is expected, and adding the `--enable-native-access=ALL-UNNAMED` flag to enable JNI will suppress it. In a future
212
+
Java version this warning may be turned into an error and the flag will be required to use TensorFlow-Java.
213
+
199
214
## TensorFlow/Java Version Support
200
215
201
216
This table shows the mapping between TensorFlow, TensorFlow Java and minimum supported Java versions.
@@ -215,7 +230,8 @@ This table shows the mapping between TensorFlow, TensorFlow Java and minimum sup
0 commit comments