如何在onnx神经网络中获得输出层的维度?
我可以得到onnx图,但没有输出尺寸:
~/onnx-tensorrt/third_party/onnx/onnx/tools/net_drawer.py --input ./weights/tiny_3l_v5_11_608.onnx --output ./weights/tiny_3l_v5_11_608.dot --embed_docstring特维辛,马库斯
发布于 2020-05-25 18:27:14
您可以简单地使用
from onnx import shape_inference
inferred_model = shape_inference.infer_shapes(original_model)并在inferred_model.graph.value_info中找到形状信息。
有关完整文档,请参阅https://github.com/onnx/onnx/blob/master/docs/ShapeInference.md
发布于 2019-08-23 20:56:17
嗨,
https://github.com/onnx/onnx-tensorrt具有此功能。
我做到了
onnx2trt yolo_tiny_3l.onnx -t yolo_tiny_3l.onnx.txt -l -v特维辛,马库斯
发布于 2021-08-11 12:08:38
如果您使用Java加载ONNX模型,则从会话中获取元数据信息。元数据包含有关输入和输出维度的详细信息。
https://stackoverflow.com/questions/57589020
复制相似问题