Open gaoxumustwin opened 1 week ago
Which version of RKNN you are using? I've tried both 1.6.0 and 2.0.0-beta and both works for me.
rknn version is 2.0.0b0+9bab5682
Here is my model conversion script from rknn.api import RKNN
if name == "main":
rknn = RKNN(verbose=False)
print('--> Config model')
rknn.config(target_platform='rk3588', dynamic_input=[[[1,1,224,224]]])
print("done")
print('--> Loading onnx model')
ret = rknn.load_onnx("super-resolution-10.onnx") # , input_size_list=[1, 1, 244, 244]
if ret != 0:
print('Load model failed!')
exit(ret)
print("done")
print('--> Building ONNX model')
ret = rknn.build(do_quantization=True, dataset="dataset.txt")
if ret != 0:
raise Exception('Build ONNX model FAILED!')
print("done")
print('--> Export to RKNN model')
ret = rknn.export_rknn("super-resolution-10.rknn")
if ret != 0:
raise Exception('Export RKNN model FAILED!')
print("done")
rknn.release()
Sorry for the late reply. I have fixed it in 1815abd6f7ad010113160f8687d1508b28348c90. Please let me know if it doesn't work.
Hello author, after converting the onnx model to rknn, the input of the rknn model is [1,1224224], and the following error occurred during the execution of infer.py: (1, 1, 224, 224) E RKNN: [03:51:51.071] rknn_set_input_shapes error, input name = input supported input shapes are as follows: E RKNN: [03:51:51.071] shape = [1,224,224,1], layout = NHWC E RKNN: [03:51:51.071] while get rknn_tensor_attr[0].name = input, dims = [1, 1, 224, 224], fmt = NHWC E Catch exception when setting inputs. E Traceback (most recent call last): File "/home/pi/archiconda3/envs/py38/lib/python3.8/site-packages/rknnlite/api/rknn_lite.py", line 200, in inference self.rknn_runtime.set_inputs(inputs, data_type, data_format, inputs_pass_through=inputs_pass_through) File "rknnlite/api/rknn_runtime.py", line 1127, in rknnlite.api.rknn_runtime.RKNNRuntime.set_inputs Exception: Set input shape failed. error code: RKNN_ERR_FAIL None By adding printing information, it was found that the dimension of img_crop in the statement out_y [sy: sy+output_size, sx: sx+output_size]=rknn. reference (inputs=[img_crop]) [0] [0] is (1, 1, 224, 224), which conforms to the input of the rknn model. However, the result of rknn. reference (inputs=[img_crop]) is a None