"vscode:/vscode.git/clone" did not exist on "3144e2a4394a544375ac054375d838525f8096c7"
Unverified Commit 6b2d1269 authored by Neal Wu's avatar Neal Wu Committed by GitHub
Browse files

Merge pull request #3324 from andrefaraujo/master

Fix file reading issue for python3 code
parents 26584e08 0d7ce10e
......@@ -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.
......@@ -169,7 +168,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