|
错误信息:
--> Running model
Traceback (most recent call last):
File "test_openpose.py", line 93, in <module>
[output] = rknn.inference(inputs=[frameinput], data_format="nchw")
File "/usr/local/lib/python3.6/dist-packages/rknn/api/rknn.py", line 350, in inference
inputs_pass_through=inputs_pass_through, get_frame_id=get_frame_id)
File "rknn/api/rknn_base.py", line 2539, in rknn.api.rknn_base.RKNNBase.inference
File "rknn/api/rknn_base.py", line 2376, in rknn.api.rknn_base.RKNNBase._inference_by_compiler
TypeError: list indices must be integers or slices, not str
源代码:
# Create RKNN object
rknn = RKNN()
# pre-process config
print('--> config model')
rknn.config(mean_values=[128, 128, 128], std_values=[128, 128, 128])
print('done')
# Load openpose model
print('--> Loading model')
# ret = rknn.load_caffe(model='./pose/coco/pose_deploy_linevec.prototxt',
# proto='caffe',
# blobs='./pose/coco/pose_deploy_linevec.caffemodel')
ret = rknn.load_rknn('./openpose_v2.rknn')
...
...
...
print('--> Init runtime environment')
ret = rknn.init_runtime()
ret = 0
if ret != 0:
print('Init runtime environment failed')
exit(ret)
print('done')
t = time.time()
frameinput = np.transpose(img, [2, 0, 1])
# Inference
print('--> Running model')
[output] = rknn.inference(inputs=[frameinput], data_format="nchw")
# show_outputs(outputs)
elapsed = time.time() - t
print('inference image: %.4f seconds.' % (elapsed))
###########
备注:
如果是按照例子,顺序转换原Caffe模式后,去调用rknn.inference 是能成功执行程序的。
###########
问题:
为什么不能在RKNN2上直接加载已转换好的模式 (openpose_v2.rknn)
|
|