Skip to content

Commit 03e752a

Browse files
committed
fix unrelated but that prevents us from writing output to current directory
1 parent e96320a commit 03e752a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tf2onnx/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ def delete_directory(path):
337337

338338

339339
def save_protobuf(path, message, as_text=False):
340-
os.makedirs(os.path.dirname(path), exist_ok=True)
340+
dir_name = os.path.dirname(path)
341+
if dir_name:
342+
os.makedirs(dir_name, exist_ok=True)
341343
if as_text:
342344
with open(path, "w") as f:
343345
f.write(text_format.MessageToString(message))

0 commit comments

Comments
 (0)