Toybrick

标题: MAC系统下,1808计算棒,按照quick start手册运行示例tflite出错 [打印本页]

作者: nj1tony    时间: 2021-1-6 17:09
标题: MAC系统下,1808计算棒,按照quick start手册运行示例tflite出错
按照手册一步步操作下来的,执行示例程序时出错,信息如下:
python3.6 test.py
--> config model
done
--> Loading model
done
--> Building model
W The target_platform is not set in config, using default target platform rk1808.
W The channel_mean_value filed will not be used in the future!
done
--> Export RKNN model
done
--> Init runtime environment
E NPUTransfer: Cannot connect to proxy: Permission denied
E RKNNAPI: rknn_init,  driver open fail!  ret = -4(ERROR_NO_DEVICE)!
E Catch exception when init runtime!
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 1154, in rknn.api.rknn_base.RKNNBase.init_runtime
E   File "rknn/api/rknn_runtime.py", line 356, in rknn.api.rknn_runtime.RKNNRuntime.build_graph
E Exception: RKNN init failed. error code: RKNN_ERR_DEVICE_UNAVAILABLE
E Current device id is: None
E Devices connected:
E ['TS018083201101749']
Init runtime environment failed




作者: jefferyzhang    时间: 2021-1-6 17:34
MAC不支持模拟器仿真,请填一个计算棒的device id在init runtime时候
作者: nj1tony    时间: 2021-1-6 17:42
计算棒设备信息如下:
./npu_transfer_proxy devices
List of ntb devices attached
TS018083201101749   422a7a1a    USB_DEVICE

我该怎么填?
ret = rknn.init_runtime(target='TS018083201101749') ?
ret = rknn.init_runtime('TS018083201101749') ?
ret = rknn.init_runtime(target='422a7a1a') ?
ret = rknn.init_runtime('422a7a1a')
作者: nj1tony    时间: 2021-1-6 19:40
我这样修改了,还是报上面一样的错误

    # init runtime environment
    print('--> Init runtime environment')
    ret = rknn.init_runtime(target='rk1808',device_id='TS018083201101749')
    if ret != 0:
        print('Init runtime environment failed')
        exit(ret)
    print('done')

作者: nj1tony    时间: 2021-1-7 08:39
关键是这个错误,我的是rknn-toolkit-v1.4.0,直接从百度网盘下载的
E NPUTransfer: Cannot connect to proxy: Permission denied
作者: jefferyzhang    时间: 2021-1-7 08:55
nj1tony 发表于 2021-1-7 08:39
关键是这个错误,我的是rknn-toolkit-v1.4.0,直接从百度网盘下载的
E NPUTransfer: Cannot connect to pro ...

sudo 运行试试,我也是mac,挺正常的跑的,还没遇到过你的问题。
作者: nj1tony    时间: 2021-1-7 08:58
jefferyzhang 发表于 2021-1-7 08:55
sudo 运行试试,我也是mac,挺正常的跑的,还没遇到过你的问题。

谢谢版主!
sudo也试过,不行。
刚刚重启了一下电脑,可以执行了。应该是安装环境及插拔计算棒时,proxy的address被占用了

python3 test.py
--> config model
done
--> Loading model
done
--> Building model
W The channel_mean_value filed will not be used in the future!
done
--> Export RKNN model
done
--> Init runtime environment
D RKNNAPI: ==============================================
D RKNNAPI: RKNN VERSION:
D RKNNAPI:   API: 1.4.0 (b4a8096 build: 2020-08-12 10:18:51)
D RKNNAPI:   DRV: 1.4.0 (b4a8096 build: 2020-09-14 11:15:57)
D RKNNAPI: ==============================================
done
--> Running model
mobilenet_v1
-----TOP 5-----
[156]: 0.85107421875
[155]: 0.09173583984375
[205]: 0.01358795166015625
[284]: 0.006465911865234375
[194]: 0.002239227294921875

done
--> Begin evaluate model performance
W When performing performance evaluation, inputs can be set to None to use fake inputs.
========================================================================
                               Performance                              
========================================================================
Total Time(us): 6940
FPS: 144.09
========================================================================





欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3