Fix bugs in encode.sh and decode.sh
authorJonghyun Park <jh1302.park@samsung.com>
Thu, 8 Mar 2018 08:04:04 +0000 (17:04 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Thu, 8 Mar 2018 22:10:37 +0000 (07:10 +0900)
This commit fixes the following bugs in encode.sh and decode.sh:
 - The use of BASH-extended syntax with /bin/sh
 - The use of relative path in protoc input

It seems that latest protoc recognizes relative path, but this commit
revises scripts to use absolute path to improve compatibility.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
tools/graphdef/decode.sh
tools/graphdef/encode.sh

index 58837bd..80b7f54 100755 (executable)
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
 
 TOOLCHAIN_BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 TENSORFLOW_BASE="${TOOLCHAIN_BASE}/../../externals/tensorflow"
 
 PROTOC="protoc"
 
-"${PROTOC}" --proto_path="${TENSORFLOW_BASE}" --decode=tensorflow.GraphDef tensorflow/core/framework/graph.proto
+"${PROTOC}" --proto_path="${TENSORFLOW_BASE}" --decode=tensorflow.GraphDef "${TENSORFLOW_BASE}/tensorflow/core/framework/graph.proto"
index ea9a945..68f03c7 100755 (executable)
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
 
 TOOLCHAIN_BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 TENSORFLOW_BASE="${TOOLCHAIN_BASE}/../../externals/tensorflow"
 
 PROTOC="protoc"
 
-"${PROTOC}" --proto_path="${TENSORFLOW_BASE}" --encode=tensorflow.GraphDef tensorflow/core/framework/graph.proto
+"${PROTOC}" --proto_path="${TENSORFLOW_BASE}" --encode=tensorflow.GraphDef "${TENSORFLOW_BASE}/tensorflow/core/framework/graph.proto"