Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tf-build
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benedikt Wildenhain
tf-build
Commits
776c02aa
Unverified
Commit
776c02aa
authored
May 23, 2022
by
William Muir
Committed by
GitHub
May 23, 2022
Browse files
Options
Downloads
Patches
Plain Diff
Update Go API installation guide for TensorFlow 2.9.0 (#105)
parent
742aed8c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
golang_install_guide/README.md
+4
-10
4 additions, 10 deletions
golang_install_guide/README.md
golang_install_guide/example-program/Dockerfile
+6
-7
6 additions, 7 deletions
golang_install_guide/example-program/Dockerfile
with
10 additions
and
17 deletions
golang_install_guide/README.md
+
4
−
10
View file @
776c02aa
...
@@ -36,7 +36,7 @@ library is required for use of the TensorFlow Go package at runtime. For example
...
@@ -36,7 +36,7 @@ library is required for use of the TensorFlow Go package at runtime. For example
on Linux (64-bit, x86):
on Linux (64-bit, x86):
```
sh
```
sh
$
curl
-L
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.
8
.0.tar.gz |
tar
xz
--directory
/usr/local
$
curl
-L
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.
9
.0.tar.gz |
tar
xz
--directory
/usr/local
$
ldconfig
$
ldconfig
```
```
...
@@ -74,7 +74,7 @@ Instead, follow these instructions.***
...
@@ -74,7 +74,7 @@ Instead, follow these instructions.***
workspace for
`/go`
in the command below.
workspace for
`/go`
in the command below.
```
sh
```
sh
$
git clone
--branch
v2.
8
.0 https://github.com/tensorflow/tensorflow.git /go/src/github.com/tensorflow/tensorflow
$
git clone
--branch
v2.
9
.0 https://github.com/tensorflow/tensorflow.git /go/src/github.com/tensorflow/tensorflow
```
```
-
Change the working directory to the base of the cloned TensorFlow repository,
-
Change the working directory to the base of the cloned TensorFlow repository,
...
@@ -85,12 +85,6 @@ Instead, follow these instructions.***
...
@@ -85,12 +85,6 @@ Instead, follow these instructions.***
$
cd
/go/src/github.com/tensorflow/tensorflow
$
cd
/go/src/github.com/tensorflow/tensorflow
```
```
-
Apply a required patch to the TensorFlow source code.
```
sh
$
git cherry-pick
--strategy-option
=
no-renames
--no-commit
65a5434
```
-
Initialize a new go.mod file.
-
Initialize a new go.mod file.
```
sh
```
sh
...
@@ -127,7 +121,7 @@ workspace for `/go` in the command below:
...
@@ -127,7 +121,7 @@ workspace for `/go` in the command below:
```
sh
```
sh
$
go mod init hello-world
$
go mod init hello-world
$
go mod edit
-require
github.com/tensorflow/tensorflow@v2.
8
.0+incompatible
$
go mod edit
-require
github.com/tensorflow/tensorflow@v2.
9
.0+incompatible
$
go mod edit
-replace
github.com/tensorflow/tensorflow
=
/go/src/github.com/tensorflow/tensorflow
$
go mod edit
-replace
github.com/tensorflow/tensorflow
=
/go/src/github.com/tensorflow/tensorflow
$
go mod tidy
$
go mod tidy
```
```
...
@@ -173,7 +167,7 @@ func main() {
...
@@ -173,7 +167,7 @@ func main() {
```
sh
```
sh
$
go mod init app
$
go mod init app
$
go mod edit
-require
github.com/tensorflow/tensorflow@v2.
8
.0+incompatible
$
go mod edit
-require
github.com/tensorflow/tensorflow@v2.
9
.0+incompatible
$
go mod edit
-replace
github.com/tensorflow/tensorflow
=
/go/src/github.com/tensorflow/tensorflow
$
go mod edit
-replace
github.com/tensorflow/tensorflow
=
/go/src/github.com/tensorflow/tensorflow
$
go mod tidy
$
go mod tidy
```
```
...
...
This diff is collapsed.
Click to expand it.
golang_install_guide/example-program/Dockerfile
+
6
−
7
View file @
776c02aa
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -14,10 +14,10 @@
...
@@ -14,10 +14,10 @@
# ============================================================================
# ============================================================================
FROM
golang:1.1
7
-bullseye
FROM
golang:1.1
8
-bullseye
# 1. Install the TensorFlow C Library (v2.
8
.0).
# 1. Install the TensorFlow C Library (v2.
9
.0).
RUN
curl
-L
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-
$(
uname
-m
)
-2
.
8
.0.tar.gz
\
RUN
curl
-L
https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-
$(
uname
-m
)
-2
.
9
.0.tar.gz
\
|
tar
xz
--directory
/usr/local
\
|
tar
xz
--directory
/usr/local
\
&&
ldconfig
&&
ldconfig
...
@@ -27,9 +27,8 @@ RUN apt-get update && apt-get -y install --no-install-recommends \
...
@@ -27,9 +27,8 @@ RUN apt-get update && apt-get -y install --no-install-recommends \
protobuf-compiler
protobuf-compiler
# 3. Install and Setup the TensorFlow Go API.
# 3. Install and Setup the TensorFlow Go API.
RUN
git clone
--branch
=
v2.
8
.0 https://github.com/tensorflow/tensorflow.git /go/src/github.com/tensorflow/tensorflow
\
RUN
git clone
--branch
=
v2.
9
.0 https://github.com/tensorflow/tensorflow.git /go/src/github.com/tensorflow/tensorflow
\
&&
cd
/go/src/github.com/tensorflow/tensorflow
\
&&
cd
/go/src/github.com/tensorflow/tensorflow
\
&&
git cherry-pick
--strategy-option
=
no-renames
--no-commit
65a5434
\
&&
go mod init github.com/tensorflow/tensorflow
\
&&
go mod init github.com/tensorflow/tensorflow
\
&&
(
cd
tensorflow/go/op
&&
go generate
)
\
&&
(
cd
tensorflow/go/op
&&
go generate
)
\
&&
go mod tidy
\
&&
go mod tidy
\
...
@@ -39,7 +38,7 @@ RUN git clone --branch=v2.8.0 https://github.com/tensorflow/tensorflow.git /go/s
...
@@ -39,7 +38,7 @@ RUN git clone --branch=v2.8.0 https://github.com/tensorflow/tensorflow.git /go/s
WORKDIR
/example-program
WORKDIR
/example-program
COPY
hello_tf.go .
COPY
hello_tf.go .
RUN
go mod init app
\
RUN
go mod init app
\
&&
go mod edit
-require
github.com/tensorflow/tensorflow@v2.
8
.0+incompatible
\
&&
go mod edit
-require
github.com/tensorflow/tensorflow@v2.
9
.0+incompatible
\
&&
go mod edit
-replace
github.com/tensorflow/tensorflow
=
/go/src/github.com/tensorflow/tensorflow
\
&&
go mod edit
-replace
github.com/tensorflow/tensorflow
=
/go/src/github.com/tensorflow/tensorflow
\
&&
go mod tidy
\
&&
go mod tidy
\
&&
go build
&&
go build
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment