File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def init_from_flags(self, flags):
102
102
setattr (self , key , getattr (flags , key ))
103
103
104
104
def init_from_json (self , json_path ):
105
- with tf .gfile .Open (json_path ) as f :
105
+ with tf .io . gfile .GFile (json_path ) as f :
106
106
json_data = json .load (f )
107
107
self .init_from_dict (json_data )
108
108
@@ -113,9 +113,9 @@ def to_json(self, json_path):
113
113
json_data [key ] = getattr (self , key )
114
114
115
115
json_dir = os .path .dirname (json_path )
116
- if not tf .gfile .Exists (json_dir ):
117
- tf .gfile .MakeDirs (json_dir )
118
- with tf .gfile .Open (json_path , 'w' ) as f :
116
+ if not tf .io . gfile .exists (json_dir ):
117
+ tf .io . gfile .makedirs (json_dir )
118
+ with tf .io . gfile .GFile (json_path , 'w' ) as f :
119
119
json .dump (json_data , f , indent = 4 , sort_keys = True )
120
120
121
121
You can’t perform that action at this time.
0 commit comments