image = cv2.imread("./test2.jpg")
with open("models/yolov5_rknn_640x640.yaml", "rb") as f:
cfg = yaml.load(f, yaml.FullLoader)
d = Detector(cfg["opt"])
d.draw_box = True
d.detect(image)
#cv2.imshow("res", image)
#cv2.waitKey()
#cv2.destroyAllWindows()
为啥rknn.init_runtime()参数后就会报错,请问大家有遇到类似的问题吗?求解决方法
具体报错: --> Init runtime environment on: 54ae867227093680
I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:51)
I NPUTransfer: Starting NPU Transfer Client, Transfer version 2.1.0 (b5861e7@2020-11-23T11:50:51)
E NPUTransfer: Transfer interface open failed!, ret = -1
E RKNNAPI: rknn_init, driver open fail! ret = -1(ERROR_IO)!
E Catch exception when init runtime!
E Traceback (most recent call last):
E File "rknn/api/rknn_base.py", line 844, in rknn.api.rknn_base.RKNNBase.init_runtime
E File "rknn/api/rknn_runtime.py", line 340, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
E Exception: RKNN init failed. error code: RKNN_ERR_DEVICE_UNAVAILABLE
Init runtime environment failed
Exception ignored in: <function Detector.__del__ at 0x7f99f61400>
Traceback (most recent call last):
File "rknn_detect_for_yolov5_original.py", line 241, in __del__
File "rknn_detect_for_yolov5_original.py", line 232, in close
AttributeError: 'Detector' object has no attribute '_rknn'