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
39f4e422
Commit
39f4e422
authored
Jan 03, 2020
by
A. Unique TensorFlower
Browse files
Fix to match the tf.gfile API change in tf2.0.
PiperOrigin-RevId: 288042402
parent
62bf6fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
official/nlp/xlnet/xlnet_config.py
official/nlp/xlnet/xlnet_config.py
+4
-4
No files found.
official/nlp/xlnet/xlnet_config.py
View file @
39f4e422
...
@@ -102,7 +102,7 @@ class XLNetConfig(object):
...
@@ -102,7 +102,7 @@ class XLNetConfig(object):
setattr
(
self
,
key
,
getattr
(
flags
,
key
))
setattr
(
self
,
key
,
getattr
(
flags
,
key
))
def
init_from_json
(
self
,
json_path
):
def
init_from_json
(
self
,
json_path
):
with
tf
.
gfile
.
Open
(
json_path
)
as
f
:
with
tf
.
io
.
gfile
.
GFile
(
json_path
)
as
f
:
json_data
=
json
.
load
(
f
)
json_data
=
json
.
load
(
f
)
self
.
init_from_dict
(
json_data
)
self
.
init_from_dict
(
json_data
)
...
@@ -113,9 +113,9 @@ class XLNetConfig(object):
...
@@ -113,9 +113,9 @@ class XLNetConfig(object):
json_data
[
key
]
=
getattr
(
self
,
key
)
json_data
[
key
]
=
getattr
(
self
,
key
)
json_dir
=
os
.
path
.
dirname
(
json_path
)
json_dir
=
os
.
path
.
dirname
(
json_path
)
if
not
tf
.
gfile
.
E
xists
(
json_dir
):
if
not
tf
.
io
.
gfile
.
e
xists
(
json_dir
):
tf
.
gfile
.
M
ake
D
irs
(
json_dir
)
tf
.
io
.
gfile
.
m
ake
d
irs
(
json_dir
)
with
tf
.
gfile
.
Open
(
json_path
,
'w'
)
as
f
:
with
tf
.
io
.
gfile
.
GFile
(
json_path
,
'w'
)
as
f
:
json
.
dump
(
json_data
,
f
,
indent
=
4
,
sort_keys
=
True
)
json
.
dump
(
json_data
,
f
,
indent
=
4
,
sort_keys
=
True
)
...
...
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