- if __name__ == '__main__':
- # Create RKNN object
- rknn = RKNN()
- ret = rknn.load_rknn(path='./mobilenet_v1.rknn')
- # Set inputs
- img = cv2.imread('./dog_224x224.jpg')
- img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
-
- # init runtime environment
- print('--> Init runtime environment')
- ret = rknn.init_runtime(target='rk3399pro')
- if ret != 0:
- print('Init runtime environment failed')
- exit(ret)
- print('done')
-
- # Inference
- print('--> Running model')
- outputs = rknn.inference(inputs=[img])
- show_outputs(outputs)
- print('done')
-
- # perf
- print('--> Begin evaluate model performance')
- perf_results = rknn.eval_perf(inputs=[img])
- print('done')
-
- rknn.release()
复制代码
如上图一段代码,在1808上运行正常。如今想在3399pro上运行,其中ret = rknn.init_runtime(target='rk1808')已经改成rk3399prohisping 发表于 2019-8-13 09:37
在开发板上运行,rknn.init_runtime不需要填写target参数
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |