Open2

ONNXモデルの形状推定機能のみを実行する

PINTOPINTO
shape_inference.py
import onnx
from argparse import ArgumentParser

parser = ArgumentParser()
parser.add_argument('file_path')
args = parser.parse_args()

model = onnx.load(args.file_path)
model = onnx.shape_inference.infer_shapes(model)
onnx.save(model, args.file_path)
PINTOPINTO
python3 shape_inference.py saved_model_HxW/model_float32.onnx