Prior to this patch, only string values could be used to specify the
path to the input ONNX file. However, several Python programs use
values of type pathlib.Path, which causes the model creation to
silently fail in onnx-tool. This patch fixes the problem by allowing
both string paths or pathlib.Path paths.
import onnx_tool
from pathlib import Path
model = onnx_tool.Model(Path("/tmp/model.onnx"))
print(model.graph) # AttributeError: 'Model' object has no attribute 'graph'
Prior to this patch, only string values could be used to specify the path to the input ONNX file. However, several Python programs use values of type
pathlib.Path
, which causes the model creation to silently fail in onnx-tool. This patch fixes the problem by allowing both string paths orpathlib.Path
paths.Credit to @xich for discovering the problem!