- --> Building model
- W Adjust min from [-5.106467] to [0.] for relu relu8_39
- W Adjust min from [-5.106467] to [0.] for relu relu13_67
- W Adjust min from [-5.106467] to [0.] for relu relu15_76
- W Adjust min from [-5.106467] to [0.] for relu relu17_85
- W Adjust min from [-4.101224] to [0.] for relu relu18_90
- W Adjust min from [-2.5565655] to [0.] for relu relu43_218
- W Adjust min from [-4.101224] to [0.] for relu relu23_118
- W Adjust min from [-4.101224] to [0.] for relu relu25_127
- W Adjust min from [-4.101224] to [0.] for relu relu27_136
- W Adjust min from [-3.4539304] to [0.] for relu relu28_141
- W Adjust min from [-24.208406] to [0.] for relu relu38_193
- W Adjust min from [-1.8253068] to [0.] for relu relu44_223
- done
复制代码
jefferyzhang 发表于 2019-12-30 08:35
量化的精度损失警告而已。relu本来就不会有负数,所以负数范围全部归0,不影响你模型推理.
转出来模型可以 ...
jefferyzhang 发表于 2019-12-30 08:35
量化的精度损失警告而已。relu本来就不会有负数,所以负数范围全部归0,不影响你模型推理.
转出来模型可以 ...
- ...
- D Process output_243 ...
- D RKNN output shape(output): (1 128 128 80)
- D Real output shape: (1, 128, 128, 80)
- I Build ctdet_coco_dlav0_1x_2 complete.
- I Running 5000 iterations
- D 0(0.02%), Queue size 0
- D 1(0.04%), Queue size 0
- D 2(0.05%), Queue size 0
- D 3(0.08%), Queue size 0
- ...
- D 195(3.92%), Queue size 0
- D 196(3.94%), Queue size 0
- D 197(3.96%), Queue size 0
- D 198(3.98%), Queue size 0
- D 199(4.00%), Queue size 0
- E Catch exception when building RKNN model!
- E Traceback (most recent call last):
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1278, in _do_call
- E return fn(*args)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1263, in _run_fn
- E options, feed_dict, fetch_list, target_list, run_metadata)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _call_tf_sessionrun
- E run_metadata)
- E tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
- E [[Node: fifo_queue_Dequeue = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](fifo_queue)]]
- E During handling of the above exception, another exception occurred:
- E Traceback (most recent call last):
- E File "rknn/api/rknn_base.py", line 584, in rknn.api.rknn_base.RKNNBase.build
- E File "rknn/api/rknn_base.py", line 1424, in rknn.api.rknn_base.RKNNBase._quantize2
- E File "rknn/base/RKNNlib/app/medusa/quantization.py", line 95, in rknn.base.RKNNlib.app.medusa.quantization.Quantization.run
- E File "rknn/base/RKNNlib/app/medusa/quantization.py", line 44, in rknn.base.RKNNlib.app.medusa.quantization.Quantization._run_quantization
- E File "rknn/base/RKNNlib/app/medusa/workspace.py", line 129, in rknn.base.RKNNlib.app.medusa.workspace.Workspace.run
- E File "rknn/base/RKNNlib/app/medusa/workspace.py", line 110, in rknn.base.RKNNlib.app.medusa.workspace.Workspace._run_iteration
- E File "rknn/base/RKNNlib/RKNN_session.py", line 30, in rknn.base.RKNNlib.RKNN_session.RKNNSession.run
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 877, in run
- E run_metadata_ptr)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1100, in _run
- E feed_dict_tensor, options, run_metadata)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1272, in _do_run
- E run_metadata)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1291, in _do_call
- E raise type(e)(node_def, op, message)
- E tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
- E [[Node: fifo_queue_Dequeue = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](fifo_queue)]]
- E Caused by op 'fifo_queue_Dequeue', defined at:
- E File "caffe2rknn.py", line 22, in <module>
- E rknn.build(do_quantization=True, dataset='dataset.txt')
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/rknn/api/rknn.py", line 166, in build
- E ret = self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, pack_vdata=pre_compile, batch_size=rknn_batch_size)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/ops/data_flow_ops.py", line 433, in dequeue
- E self._queue_ref, self._dtypes, name=name)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 3734, in queue_dequeue_v2
- E timeout_ms=timeout_ms, name=name)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
- E op_def=op_def)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
- E return func(*args, **kwargs)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3155, in create_op
- E op_def=op_def)
- E File "/home/lsc/anaconda3/envs/RKNN/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1717, in __init__
- E self._traceback = tf_stack.extract_stack()
- E OutOfRangeError (see above for traceback): FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
- E [[Node: fifo_queue_Dequeue = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](fifo_queue)]]
复制代码
jefferyzhang 发表于 2019-12-30 10:01
1. 请问下您使用的rknn toolkit版本号,早期版本有这个问题,但是后来已经修复了,至少1.2.1上应该不会有这 ...
jefferyzhang 发表于 2019-12-30 10:25
用1.3.0试下,https://eyun.baidu.com/enterprise/share/init?cid=8272257679089781337&uk=2751701137&sid= ...
LSC 发表于 2019-12-30 10:37
是的PC,Linux,CPU上,epochs=100就不报这个错误,但是检测的时候一个框都检测不到。
好的,我去试试1.3. ...
- D 196(3.94%), Queue size 0
- D 197(3.96%), Queue size 0
- D 198(3.98%), Queue size 0
- D 199(4.00%), Queue size 0
- E Catch exception when building RKNN model!
- Exception in thread Thread-1:
- Traceback (most recent call last):
- File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/threading.py", line 916, in _bootstrap_inner
- self.run()
- File "rknn/base/acuitylib/provider/queue_provider.py", line 98, in rknn.base.acuitylib.provider.queue_provider.QueueProvider.run
- File "rknn/base/acuitylib/provider/queue_provider.py", line 102, in rknn.base.acuitylib.provider.queue_provider.QueueProvider.ru
- File "rknn/base/acuitylib/provider/text_provider.py", line 65, in rknn.base.acuitylib.provider.text_provider.TextProvider.get_ba
- File "rknn/base/acuitylib/provider/base_provider.py", line 163, in rknn.base.acuitylib.provider.base_provider.BaseProvider._tens_batch
- File "rknn/base/acuitylib/provider/base_provider.py", line 105, in rknn.base.acuitylib.provider.base_provider.BaseProvider._reshs
- File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 292, in reshape
- return _wrapfunc(a, 'reshape', newshape, order=order)
- File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
- return getattr(obj, method)(*args, **kwds)
- ValueError: cannot reshape array of size 262144 into shape (1,512,512,3)
- E Traceback (most recent call last):
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1292, in _do_ca
- E return fn(*args)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1277, in _run_f
- E options, feed_dict, fetch_list, target_list, run_metadata)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1367, in _call_run
- E run_metadata)
- E tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requurrent size 0)
- E [[{{node fifo_queue_Dequeue}} = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replicadevice:CPU:0"](fifo_queue)]]
- E During handling of the above exception, another exception occurred:
- E Traceback (most recent call last):
- E File "rknn/api/rknn_base.py", line 737, in rknn.api.rknn_base.RKNNBase.build
- E File "rknn/api/rknn_base.py", line 1644, in rknn.api.rknn_base.RKNNBase._quantize2
- E File "rknn/base/RKNNlib/app/medusa/quantization.py", line 105, in rknn.base.RKNNlib.app.medusa.quantization.Quantization.run
- E File "rknn/base/RKNNlib/app/medusa/quantization.py", line 44, in rknn.base.RKNNlib.app.medusa.quantization.Quantization._run_qn
- E File "rknn/base/RKNNlib/app/medusa/workspace.py", line 135, in rknn.base.RKNNlib.app.medusa.workspace.Workspace.run
- E File "rknn/base/RKNNlib/app/medusa/workspace.py", line 116, in rknn.base.RKNNlib.app.medusa.workspace.Workspace._run_iteration
- E File "rknn/base/RKNNlib/RKNN_session.py", line 30, in rknn.base.RKNNlib.RKNN_session.RKNNSession.run
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 887, in run
- E run_metadata_ptr)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1110, in _run
- E feed_dict_tensor, options, run_metadata)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1286, in _do_ru
- E run_metadata)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1308, in _do_ca
- E raise type(e)(node_def, op, message)
- E tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requurrent size 0)
- E [[{{node fifo_queue_Dequeue}} = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replicadevice:CPU:0"](fifo_queue)]]
- E Caused by op 'fifo_queue_Dequeue', defined at:
- E File "caffe2rknn.py", line 22, in <module>
- E rknn.build(do_quantization=True, dataset='dataset.txt')
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/rknn/api/rknn.py", line 238, in build
- E ret = self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, pack_vdata=pre_compile, batch_size=rknn_batch_s
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/ops/data_flow_ops.py", line 433, in dequ
- E self._queue_ref, self._dtypes, name=name)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 3735, inueue_v2
- E timeout_ms=timeout_ms, name=name)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, op_helper
- E op_def=op_def)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_f
- E return func(*args, **kwargs)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3272, in create_
- E op_def=op_def)
- E File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1768, in __init_
- E self._traceback = tf_stack.extract_stack()
- E OutOfRangeError (see above for traceback): FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, curre
- E [[{{node fifo_queue_Dequeue}} = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replicadevice:CPU:0"](fifo_queue)]]
- done
复制代码
- >>> from rknn.api import RKNN
- >>> import cv2
- >>> import numpy as np
- >>> rknn = RKNN()
- >>> rknn_model = "../ctdet_coco_dlav0_1x_q2.rknn"
- >>> rknn.load_rknn(rknn_model)
- 0
- >>> rknn.init_runtime()
- Segmentation fault (core dumped)
复制代码
LSC 发表于 2019-12-30 22:03
然而调用这个模型时,在init_runtime这一步发生了段错误。
jefferyzhang 发表于 2019-12-31 08:19
把pb原文件和转换脚本一起发给我,我转给NPU的同事debug
LSC 发表于 2019-12-31 08:48
1.3.0版本会发生段错误,1.2.0不会,还是先继续用1.2.0吧
jefferyzhang 发表于 2019-12-31 14:18
嗯,这个段错误主要是因为1.3和你固件驱动不匹配,新版本固件我们下个月会发布 ...
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |