openvino: [Bug]: RuntimeError: Exception from [CPU] Loop node with name 'Loop.0' at src/plugins/intel_cpu/src/nodes/tensoriterator.cpp:182
OpenVINO Version
2024.6.0
Operating System
Ubuntu 18.04 (LTS)
Device used for inference
CPU
Framework
ONNX
Model used
slanet_plus
Issue description
convert paddlepaddle model to onnx model, use openvino to inference, but get error
Step-by-step reproduction
use paddle2onnx to convert model to onnx model
inference code:
class TableRecOpenvino():
def __init__(self, model_path):
super(TableRecOpenvino, self).__init__()
# core = Core()
# model = core.read_model(model=model_path,weights=model_path.replace('.xml','.bin'))
# self.net = core.compile_model(model=model, device_name="CPU")
# ie = IECore()
# self.net = ie.read_network(model=model_path,weights=model_path.replace('.xml','.bin'))
ov_model = ov.convert_model("./weights/slanet-plus.onnx")
self.net = ov.compile_model(ov_model, "AUTO")
self.preprocess_op = TablePreprocess()
self.postprocess_op = TableLabelDecode(slanet_plus_character)
def async_infer(self, img):
infer_request = self.net.create_infer_request()
# 设置输入数据
infer_request.set_input_tensor(Tensor(img))
# 启动异步推理
infer_request.start_async()
# 等待推理完成
infer_request.wait()
# 获取多个输出张量
output_tensors = [infer_request.get_output_tensor(i) for i in range(len(self.net.outputs))]
# 提取输出数据并返回
output_data = [output_tensor.data for output_tensor in output_tensors]
return output_data
def rec_img(self, img):
import pdb
pdb.set_trace()
starttime = time.time()
data = {"image": img}
data = self.preprocess_op(data)
img = data[0]
if img is None:
return None, 0
img = np.expand_dims(img, axis=0)
img_data = img.copy()
outputs = self.async_infer(img_data)
preds = {"loc_preds": outputs[0], "structure_probs": outputs[1]}
shape_list = np.expand_dims(data[-1], axis=0)
post_result = self.postprocess_op(preds, [shape_list])
bbox_list = post_result["bbox_batch_list"][0]
structure_str_list = post_result["structure_batch_list"][0]
structure_str_list = structure_str_list[0]
structure_str_list = (
["<html>", "<body>", "<table>"]
+ structure_str_list
+ ["</table>", "</body>", "</html>"]
)
elapse = time.time() - starttime
return structure_str_list, adapt_bboxes(bbox_list), elapse
error:
RuntimeError: Exception from src/inference/src/cpp/infer_request.cpp:245: Exception from src/bindings/python/src/pyopenvino/core/infer_request.hpp:54: Caught exception: Exception from src/plugins/intel_cpu/src/node.cpp:746: [CPU] Loop node with name ‘Loop.0’ Check ‘mem->getShape() == Shape(VectorDims{1})’ failed at src/plugins/intel_cpu/src/nodes/tensoriterator.cpp:182
Relevant log output
No response
Issue submission checklist
- I’m reporting an issue. It’s not a question.
- I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
- There is reproducer code and related data files such as images, videos, models, etc.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (5 by maintainers)
Commits related to this issue
- Add scalar case if "then" and "else" subgraph output are scalar. (#28444) ### Details: - *if "then" and "else" subgraph output shape are scalar, the if node output shape should be static and a scalar... — committed to openvinotoolkit/openvino by mangguo321 2 years ago
- Add scalar case if "then" and "else" subgraph output are scalar. (#28444) ### Details: - *if "then" and "else" subgraph output shape are scalar, the if node output shape should be static and a scalar... — committed to MirceaDan99/openvino by mangguo321 2 years ago
I opened the ONNX model using Netron, and the error may occurs at the following location:
I’m not sure if OpenVINO does not support this. I’ve converted many models from ONNX to OpenVINO before, and this is the first time I’ve encountered this issue.