Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
0d7ce10e
Commit
0d7ce10e
authored
Feb 05, 2018
by
Andre Araujo
Browse files
Fix file reading issue for python3 code
parent
72699325
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
research/delf/delf/python/datum_io.py
research/delf/delf/python/datum_io.py
+1
-2
research/delf/delf/python/feature_io.py
research/delf/delf/python/feature_io.py
+1
-2
No files found.
research/delf/delf/python/datum_io.py
View file @
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
,
'r
b
'
)
as
f
:
return
ParseFromString
(
f
.
read
())
...
...
research/delf/delf/python/feature_io.py
View file @
0d7ce10e
...
...
@@ -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
,
'r
b
'
)
as
f
:
return
ParseFromString
(
f
.
read
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment