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
+50Lines changed: 50 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,56 @@
3
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
4
how to migrate your code from a previous version to a new one that includes some changes that are not backward compatible.
5
5
6
+
## Migrating to 1.0.0
7
+
8
+
TensorFlow-Java 1.0.0 requires Java 11 or later.
9
+
10
+
### Native Artifact Renaming
11
+
12
+
The native artifacts, that used to be distributed as `tensorflow-core-api`, are now distributed under `tensorflow-core-native`. If you still add
13
+
`tensorflow-core-platform` in your project, that won't affect you. But if you were adding dependencies to specific native runtimes, you need to update
14
+
them to reflect the new artifact name.
15
+
16
+
For example,
17
+
```xml
18
+
<dependency>
19
+
<groupId>org.tensorflow</groupId>
20
+
<artifactId>tensorflow-core-api</artifactId>
21
+
<version>0.5.0</version>
22
+
</dependency>
23
+
<dependency>
24
+
<groupId>org.tensorflow</groupId>
25
+
<artifactId>tensorflow-core-api</artifactId>
26
+
<version>0.5.0</version>
27
+
<classifier>linux-x86_64</classifier>
28
+
</dependency>
29
+
```
30
+
will now be
31
+
```xml
32
+
<dependency>
33
+
<groupId>org.tensorflow</groupId>
34
+
<artifactId>tensorflow-core-api</artifactId>
35
+
<version>1.0.0</version>
36
+
</dependency>
37
+
<dependency>
38
+
<groupId>org.tensorflow</groupId>
39
+
<artifactId>tensorflow-core-native</artifactId>
40
+
<version>1.0.0</version>
41
+
<classifier>linux-x86_64</classifier>
42
+
</dependency>
43
+
```
44
+
### Session Run Result
45
+
46
+
In versions before 0.4.0 `Session.Runner.run` and `TensorFunction.call` returned a `List<Tensor>`. In newer versions
47
+
they return a `Result` class which is `AutoCloseable` to make management of the tensor lifetime simpler. To migrate
48
+
users should wrap the `run` invocation in a try-with-resources statement rather than closing the output tensors
49
+
individually.
50
+
51
+
### Proto Definitions Moved
52
+
53
+
Some proto definitions under `org.tensorflow.proto` have been moved to a different location under the same package. You will need to reimport these
54
+
proto bindings to match the new location. Your IDE should easily be able to do this for you.
Copy file name to clipboardExpand all lines: README.md
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -56,24 +56,24 @@ restrictive.
56
56
While TensorFlow Java can be compiled for [multiple platforms](https://github.com/tensorflow/java/blob/master/tensorflow-core/pom.xml#L54),
57
57
only binaries for the followings are being **supported and distributed** by this project:
58
58
59
-
-`linux-x86_64`: Linux platforms on Intel chips
60
-
-`linux-x86_64-gpu`: Linux platforms on Intel chips with Cuda GPU support
61
-
-`macosx-x86_64`: MacOS X platforms on Intel chips
59
+
-`linux-x86_64`: Linux platforms on Intel/AMD chips
60
+
-`linux-x86_64-gpu`: Linux platforms on Intel/AMD chips with Cuda GPU support
61
+
-`macosx-x86_64`: MacOS X platforms on Intel/AMD chips
62
62
-`macosx-arm64`: MacOS X platforms on Apple Silicon chips
63
-
-`windows-x86_64`: Windows platforms on Intel chips
63
+
-`windows-x86_64`: Windows platforms on Intel/AMD chips
64
64
65
65
For example, for building a JAR that uses TensorFlow and is targeted to be deployed only on Linux
66
66
systems with no GPU support, you should add the following dependencies:
67
67
```xml
68
68
<dependency>
69
69
<groupId>org.tensorflow</groupId>
70
70
<artifactId>tensorflow-core-api</artifactId>
71
-
<version>0.5.0</version>
71
+
<version>1.0.0-rc.1</version>
72
72
</dependency>
73
73
<dependency>
74
74
<groupId>org.tensorflow</groupId>
75
75
<artifactId>tensorflow-core-native</artifactId>
76
-
<version>0.5.0</version>
76
+
<version>1.0.0-rc.1</version>
77
77
<classifier>linux-x86_64</classifier>
78
78
</dependency>
79
79
```
@@ -84,24 +84,24 @@ native dependencies as follows:
84
84
<dependency>
85
85
<groupId>org.tensorflow</groupId>
86
86
<artifactId>tensorflow-core-api</artifactId>
87
-
<version>0.5.0</version>
87
+
<version>1.0.0-rc.1</version>
88
88
</dependency>
89
89
<dependency>
90
90
<groupId>org.tensorflow</groupId>
91
91
<artifactId>tensorflow-core-native</artifactId>
92
-
<version>0.5.0</version>
92
+
<version>1.0.0-rc.1</version>
93
93
<classifier>linux-x86_64-gpu</classifier>
94
94
</dependency>
95
95
<dependency>
96
96
<groupId>org.tensorflow</groupId>
97
97
<artifactId>tensorflow-core-native</artifactId>
98
-
<version>0.5.0</version>
98
+
<version>1.0.0-rc.1</version>
99
99
<classifier>macosx-arm64</classifier>
100
100
</dependency>
101
101
<dependency>
102
102
<groupId>org.tensorflow</groupId>
103
103
<artifactId>tensorflow-core-native</artifactId>
104
-
<version>0.5.0</version>
104
+
<version>1.0.0-rc.1</version>
105
105
<classifier>windows-x86_64</classifier>
106
106
</dependency>
107
107
```
@@ -116,13 +116,13 @@ required to run TensorFlow Java on any [supported platforms](README.md#individua
116
116
117
117
-`tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `macosx-arm64`, `macosx-x86_64` and `windows-x86_64`
118
118
119
-
For example, to run TensorFlow Java on any platform for which a binary is being distributed by this project, you can
119
+
For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can
120
120
simply add this dependency to your application:
121
121
```xml
122
122
<dependency>
123
123
<groupId>org.tensorflow</groupId>
124
124
<artifactId>tensorflow-core-platform</artifactId>
125
-
<version>0.5.0</version>
125
+
<version>1.0.0-rc.1</version>
126
126
</dependency>
127
127
```
128
128
@@ -172,7 +172,7 @@ This table shows the mapping between TensorFlow, TensorFlow Java and minimum sup
0 commit comments