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: compile_tensorflow_cpp.md
+48-24Lines changed: 48 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,38 +2,51 @@
2
2
3
3
Building TensorFlow C++ API is very tricky and can be a pain as there is not much information you can find about it even on TensorFlow's official documentation. Following you will find a step-by-step instruction showing how to build TensorFlow C++ v2 on Linux. It works well for my Ubuntu 20.04 running on AMD Ryzen processors.
4
4
5
+
In this page I will walk you through the steps to install TensorFlow C++ API version 2.7.
6
+
5
7
## Dependencies
6
8
7
9
- Conda environment
8
10
- Python 3.9.0
9
-
- TensorFlow 2.7
10
11
- Bazel 3.7.2
11
12
- Protobuf 3.9.2 (must be compatible with the version of TensorFlow-built protobuf or protoc)
12
13
13
-
## Environment setup & install Python
14
+
---
15
+
16
+
## Install package dependencies
17
+
18
+
### 1. Environment setup & install Python
14
19
```
15
20
conda create -n tfcc
16
21
conda activate tfcc
17
-
conda install python
22
+
conda install python==3.9
18
23
conda update --all -y
19
24
```
20
25
21
-
## Install bazel
26
+
### 2. Install bazel
22
27
```
23
28
sudo apt install bazel-3.7.2
24
29
```
25
30
26
-
## Install TensorFlow CC
27
-
```
31
+
### 3. Install Protobuf
32
+
33
+
I suggest installing protobuf after building TensorFlow so that we can check that which version of protobuf we have to use.
34
+
35
+
---
36
+
37
+
## Compile TensorFlow C++ and install libraries
38
+
39
+
### 1. Compile TensorFlow C++ shared library (with optimization)
0 commit comments