Context manager open(file) as f fixes (#7289)
* Flask context manager `open()` fix * Additional read context manager fixes
This commit is contained in:
1 parent
2181ef371e
commit
5f97001ed4
5 files changed
+17
-6
No files matched your search
@@ -407,7 +407,8 @@ def export_tfjs(keras_model, im, file, prefix=colorstr('TensorFlow.js:')):
|
||||
f'--output_node_names="Identity,Identity_1,Identity_2,Identity_3" {f_pb} {f}'
|
||||
subprocess.run(cmd, shell=True)
|
||||
|
||||
json = open(f_json).read()
|
||||
with open(f_json) as j:
|
||||
json = j.read()
|
||||
with open(f_json, 'w') as j: # sort JSON Identity_* in ascending order
|
||||
subst = re.sub(
|
||||
r'{"outputs": {"Identity.?.?": {"name": "Identity.?.?"}, '
|
||||
|
||||
Reference in new issue
Block a user