|
【人工智能】
运行demo Cannot allocate memory
发表于 2021-4-9 11:58:35
浏览:5091
|
回复:0
打印
只看该作者
[复制链接]
楼主
(venv) root@firefly:~/rknn-toolkit-v1.6.0/examples/tflite/mobilenet_v1# python3 test.py
*************************
all device(s) with ntb mode:
0123456789ABCDEF
*************************
--> config model
done
--> Loading model
W:tensorflow:From /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:104: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.
W:tensorflow:From /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:104: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
W:tensorflow:From /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:104: 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 /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:244: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.
W:tensorflow:From /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:244: The name tf.FIFOQueue is deprecated. Please use tf.queue.FIFOQueue instead.
W:tensorflow:From /root/venv/lib/python3.7/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 /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:244: The name tf.nn.avg_pool is deprecated. Please use tf.nn.avg_pool2d instead.
W:tensorflow:From /root/venv/lib/python3.7/site-packages/rknn/api/rknn.py:244: 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
E Catch exception when init runtime!
E Traceback (most recent call last):
E File "rknn/api/rknn_base.py", line 815, in rknn.api.rknn_base.RKNNBase.init_runtime
E File "rknn/api/rknn_runtime.py", line 170, in rknn.api.rknn_runtime.RKNNRuntime.__init__
E File "rknn/api/rknn_platform_utils.py", line 294, in rknn.api.rknn_platform_utils.start_ntp_or_adb
E File "rknn/api/rknn_platform_utils.py", line 149, in rknn.api.rknn_platform_utils.weather_device_use_ntb
E File "rknn/api/rknn_utils.py", line 56, in rknn.api.rknn_utils.exec_command
E File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
E **kwargs).stdout
E File "/usr/lib/python3.7/subprocess.py", line 488, in run
E with Popen(*popenargs, **kwargs) as process:
E File "/usr/lib/python3.7/subprocess.py", line 800, in __init__
E restore_signals, start_new_session)
E File "/usr/lib/python3.7/subprocess.py", line 1482, in _execute_child
E restore_signals, start_new_session, preexec_fn)
E OSError: [Errno 12] Cannot allocate memory
E Current device id is: 0123456789ABCDEF
E Devices connected:
Traceback (most recent call last):
File "test.py", line 65, in <module>
ret = rknn.init_runtime(target='rk1808',device_id='0123456789ABCDEF')
File "/root/venv/lib/python3.7/site-packages/rknn/api/rknn.py", line 389, in init_runtime
adb_devices, ntb_devices = self.rknn_base.list_devices()
File "rknn/api/rknn_base.py", line 779, in rknn.api.rknn_base.RKNNBase.list_devices
File "rknn/api/rknn_platform_utils.py", line 345, in rknn.api.rknn_platform_utils.get_ntb_devices
File "rknn/api/rknn_utils.py", line 56, in rknn.api.rknn_utils.exec_command
File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1482, in _execute_child
restore_signals, start_new_session, preexec_fn)
OSError: [Errno 12] Cannot allocate memory
|
|