Skip to content

Commit c26ca8b

Browse files
authored
Fix a bug for large models in onnx importer. (#3875)
The method `onnx.load_external_data_for_model` function does not admit `pathlib.Path` as an input.
1 parent 0eba539 commit c26ca8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/torch_mlir/tools/import_onnx/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def load_onnx_model(args: argparse.Namespace) -> onnx.ModelProto:
137137
# Load the temp file and the external data.
138138
inferred_model = onnx.load(temp_inferred_file, load_external_data=False)
139139
data_dir = Path(input_dir if args.temp_dir is None else args.data_dir)
140-
onnx.load_external_data_for_model(inferred_model, data_dir)
140+
onnx.load_external_data_for_model(inferred_model, str(data_dir))
141141

142142
# Remove the inferred shape file unless asked to keep it
143143
if not args.keep_temps:

0 commit comments

Comments
 (0)