Skip to content

Commit 30dfb0d

Browse files
Conchylicultorcopybara-github
authored andcommitted
Update instructions to generate the protobuf
PiperOrigin-RevId: 292157231
1 parent 1375a51 commit 30dfb0d

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

tensorflow_datasets/core/proto/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ default, the protobuf is already compiled into python file so you won't have to
55
do anything. Those steps are required only if you update the `.proto` file. The
66
instruction are for linux.
77

8-
Install the proto compiler (version 3.6.1):
8+
## Install the proto compiler
9+
910

1011
```
1112
./install_protoc.sh
1213
```
1314

14-
Re-generate the python file:
15+
## Re-generate the python file
1516

1617
```
17-
./generate_pb2_py.sh
18+
./generate_py_proto.sh
1819
```
20+

tensorflow_datasets/core/proto/generate_py_proto.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66

77
# Ensure we have the desired protoc version.
8-
if [[ $(protoc --version) != 'libprotoc 3.6.1' ]]; then
9-
echo 'Please use version 3.6.1 of protoc for compatibility with Python 2 and 3.'
8+
if [[ $(protoc --version) != 'libprotoc 3.11.2' ]]; then
9+
echo 'Please use version 3.11.2 or above.'
1010
echo 'Please run install_protoc.sh to install it.'
1111
exit
1212
fi

tensorflow_datasets/core/proto/install_protoc.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22
# Install the .protoc compiler on Linux
33

4-
54
# Make sure you grab the latest version
6-
curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
5+
curl -OL https://github.com/google/protobuf/releases/download/v3.11.2/protoc-3.11.2-linux-x86_64.zip
76

87
# Unzip
9-
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
8+
unzip protoc-3.11.2-linux-x86_64.zip -d protoc3
9+
1010

1111
# Move protoc to /usr/local/bin/
1212
sudo mv protoc3/bin/* /usr/local/bin/

0 commit comments

Comments
 (0)