Skip to content
Snippets Groups Projects
Unverified Commit 776c02aa authored by William Muir's avatar William Muir Committed by GitHub
Browse files

Update Go API installation guide for TensorFlow 2.9.0 (#105)

parent 742aed8c
Branches
No related tags found
No related merge requests found
...@@ -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
``` ```
......
# Copyright 2021 The TensorFlow Authors. All Rights Reserved. # Copyright 2022 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.17-bullseye FROM golang:1.18-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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment