我用yolov5训练了一个模型,它运行得很好:

我的最终目标是在Openvino框架中使用我在定制数据(检测钩子和桶)方面培训过的模型。
为此,我首先使用以下命令将模型的最佳版本导出为适当的Openvino格式:
!python export.py --weights runs/train/yolov5s24/weights/best.pt --include openvino --dynamic --simplify导出成功地生成了3个文件: best.xml、best.bin、best.mapping;
现在我想使用Openvino框架加载它,对此,我将遵循这个管道
1创建核心
import numpy as np
import openvino.inference_engine as ie
core = ie.IECore()2从驱动器中读取模型
path_to_xml_file = 'models/best_openvino_model/best.xml'
path_to_bin_file = 'models/best_openvino_model/best.bin'
network = core.read_network(model=path_to_xml_file, weights=path_to_bin_file)3将模型加载到设备上
# Load network to the device and create infer requests
exec_network = core.load_network(network, "CPU", num_requests=4)现在我收到了一个错误:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-21-7c9ba5f53484> in <module>
1 # Load network to the device and create infer requests
----> 2 exec_network = core.load_network(network, "CPU", num_requests=4)
ie_api.pyx in openvino.inference_engine.ie_api.IECore.load_network()
ie_api.pyx in openvino.inference_engine.ie_api.IECore.load_network()
RuntimeError: Check 'std::get<0>(valid)' failed at inference/src/ie_core.cpp:1414:
InferenceEngine::Core::LoadNetwork doesn't support inputs having dynamic shapes. Use ov::Core::compile_model API instead. Dynamic inputs are :{ input:'images,images', shape={?,3,?,?}} 我正在使用OpenVINO™开发工具-Release2022.1;用于复制错误的文件是这里;
https://stackoverflow.com/questions/71970869
复制相似问题