"vscode:/vscode.git/clone" did not exist on "1602973fadaf018e9fdde0fc4a305a075ea6bd51"
Commit 0d7ce10e authored by Andre Araujo's avatar Andre Araujo
Browse files

Fix file reading issue for python3 code

parent 72699325
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Python interface for DatumProto.
DatumProto is protocol buffer used to serialize tensor with arbitrary shape.
......@@ -93,7 +92,7 @@ def ReadFromFile(file_path):
Returns:
data: Numpy array.
"""
with tf.gfile.FastGFile(file_path, 'r') as f:
with tf.gfile.FastGFile(file_path, 'rb') as f:
return ParseFromString(f.read())
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Python interface for DelfFeatures proto.
Support read and write of DelfFeatures from/to numpy arrays and file.
......@@ -168,7 +167,7 @@ def ReadFromFile(file_path):
attention: [N] float array with attention scores.
orientations: [N] float array with orientations.
"""
with tf.gfile.FastGFile(file_path, 'r') as f:
with tf.gfile.FastGFile(file_path, 'rb') as f:
return ParseFromString(f.read())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment