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
9cac7637
Commit
9cac7637
authored
Jan 24, 2018
by
cclauss
Browse files
file() was removed in Python 3 (en masse)
parent
c24e1f41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
research/syntaxnet/dragnn/python/dragnn_model_saver_lib_test.py
...ch/syntaxnet/dragnn/python/dragnn_model_saver_lib_test.py
+1
-1
research/syntaxnet/dragnn/python/graph_builder_test.py
research/syntaxnet/dragnn/python/graph_builder_test.py
+1
-1
research/syntaxnet/syntaxnet/lexicon_builder_test.py
research/syntaxnet/syntaxnet/lexicon_builder_test.py
+2
-2
No files found.
research/syntaxnet/dragnn/python/dragnn_model_saver_lib_test.py
View file @
9cac7637
...
...
@@ -45,7 +45,7 @@ class DragnnModelSaverLibTest(test_util.TensorFlowTestCase):
master_spec
=
spec_pb2
.
MasterSpec
()
root_dir
=
os
.
path
.
join
(
FLAGS
.
test_srcdir
,
'dragnn/python'
)
with
file
(
os
.
path
.
join
(
root_dir
,
'testdata'
,
spec_path
),
'r'
)
as
fin
:
with
open
(
os
.
path
.
join
(
root_dir
,
'testdata'
,
spec_path
),
'r'
)
as
fin
:
text_format
.
Parse
(
fin
.
read
().
replace
(
'TOPDIR'
,
root_dir
),
master_spec
)
return
master_spec
...
...
research/syntaxnet/dragnn/python/graph_builder_test.py
View file @
9cac7637
...
...
@@ -246,7 +246,7 @@ class GraphBuilderTest(test_util.TensorFlowTestCase):
master_spec
=
spec_pb2
.
MasterSpec
()
testdata
=
os
.
path
.
join
(
FLAGS
.
test_srcdir
,
'dragnn/core/testdata'
)
with
file
(
os
.
path
.
join
(
testdata
,
spec_path
),
'r'
)
as
fin
:
with
open
(
os
.
path
.
join
(
testdata
,
spec_path
),
'r'
)
as
fin
:
text_format
.
Parse
(
fin
.
read
().
replace
(
'TESTDATA'
,
testdata
),
master_spec
)
return
master_spec
...
...
research/syntaxnet/syntaxnet/lexicon_builder_test.py
View file @
9cac7637
...
...
@@ -140,7 +140,7 @@ class LexiconBuilderTest(test_util.TensorFlowTestCase):
self
.
assertTrue
(
last
)
def
ValidateTagToCategoryMap
(
self
):
with
file
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
'tag-to-category'
),
'r'
)
as
f
:
with
open
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
'tag-to-category'
),
'r'
)
as
f
:
entries
=
[
line
.
strip
().
split
(
'
\t
'
)
for
line
in
f
.
readlines
()]
for
tag
,
category
in
entries
:
self
.
assertIn
(
tag
,
TAGS
)
...
...
@@ -148,7 +148,7 @@ class LexiconBuilderTest(test_util.TensorFlowTestCase):
def
LoadMap
(
self
,
map_name
):
loaded_map
=
{}
with
file
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
map_name
),
'r'
)
as
f
:
with
open
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
map_name
),
'r'
)
as
f
:
for
line
in
f
:
entries
=
line
.
strip
().
split
(
' '
)
if
len
(
entries
)
>=
2
:
...
...
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