第二次再运行python test.py,就卡在--> Init runtime environment就不动了。。。
Use tf.where in 2.0, which has the same broadcast rule as np.where
done
--> Export RKNN model
done
--> Init runtime environment
python test.py
--> config model
done
--> Loading model
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:106: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:106: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:106: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
done
--> Building model
W The target_platform is not set in config, using default target platform rk1808.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:257: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:257: The name tf.FIFOQueue is deprecated. Please use tf.queue.FIFOQueue instead.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\control_flow_ops.py:1814: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version.
Instructions for updating:
tf.py_func is deprecated in TF V2. Instead, there are two
options available in V2.
- tf.py_function takes a python function which manipulates tf eager
tensors instead of numpy arrays. It's easy to convert a tf eager tensor to
an ndarray (just call tensor.numpy()) but having access to eager tensors
means `tf.py_function`s can use accelerators such as GPUs as well as
being differentiable using a gradient tape.
- tf.numpy_function maintains the semantics of the deprecated tf.py_func
(it is not differentiable, and manipulates numpy arrays). It drops the
stateful argument making all functions stateful.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:257: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.
W:tensorflow:From C:\Users\Test\AppData\Roaming\Python\Python36\site-packages\rknn\api\rknn.py:257: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
done
--> Export RKNN model
done
--> Init runtime environment作者: cyberdong 时间: 2021-9-21 13:18
等了好久,终于出现了错误信息:
--> Init runtime environment
E RKNNAPI: rknn_init, recv(MsgLoadAck) fail, -9 != 368!
E Catch exception when init runtime!
E Traceback (most recent call last):
E File "rknn\api\rknn_base.py", line 884, in rknn.api.rknn_base.RKNNBase.init_runtime
E File "rknn\api\rknn_runtime.py", line 341, 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 ['TS018083200400200']
Init runtime environment failed作者: cyberdong 时间: 2021-9-21 15:59
另外,如何获取device ID呢?下面这个命令的输出跟文档不一样,没有显示Device ID
W:\workspace\mobilenet_v1
λ python -m rknn.bin.list_devices
*************************
all device(s) with ntb mode:
TS018083200400200
*************************作者: cyberdong 时间: 2021-9-21 16:05
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from rknn.api import RKNN
>>> rknn=RKNN()
>>> rknn.list_devices()
*************************
all device(s) with ntb mode:
TS018083200400200
*************************
([], ['TS018083200400200']) -- 这个就是Device ID吗?
>>> rknn.release()作者: cyberdong 时间: 2021-9-21 16:14
卡在这个地方了:
--> Init runtime environment
D target set by user is: rk1808
D Starting ntp or adb, target is RK1808, host is None
D Start ntp...
I npu_transfer_proxy pid: 10704, status: running