model_path = 'model.onnx'
model = onnx.load(model_path)
weights = []
names = []
for t in model.graph.initializer:
weights.append(numpy_helper.to_array(t))
names.append(t.name)
model_weights = {}
for name, weight in zip(names, weights):
model_weights[name] = weight
print(model_weights)
查看 ONNX 模型 weights
最新推荐文章于 2024-08-06 08:06:07 发布