|
1、 dataset.txt的列表与实际文件不符,目录下只有100张图片,txt中有200.
2、不使用混合量化,直接使用:
- # pre-process config
- print('--> config model')
- rknn.config(channel_mean_value='127.5 127.5 127.5 128', reorder_channel='0 1 2', quantized_dtype='asymmetric_quantized-u8')
- print('done')
- # Load tflite model
- print('--> Loading model')
- ret = rknn.load_tensorflow(tf_pb='./ssd_mobilenet_v2.pb',
- inputs=['FeatureExtractor/MobilenetV2/MobilenetV2/input'],
- outputs=['concat_1', 'concat'],
- input_size_list=[[300,300,3]],
- predef_file=None)
- if ret != 0:
- print('Load model failed!')
- exit(ret)
- print('done')
-
- ret = rknn.build(do_quantization=True, dataset='dataset.txt', rknn_batch_size=1)
-
- rknn_file = 'ssd_mobilenet_v2.pb-def-quant.rknn'
- print('export:', rknn_file, '...')
- rknn.export_rknn(rknn_file)
报错:
D RKNN output shape(output): (100 1917 1 4)
D Real output shape: (100, 1917, 1, 4)
I Build ssd_mobilenet_v2 complete.
I Running 1 iterations
Exception in thread Thread-1:
Traceback (most recent call last):
File "D:\Program Files\Python\Python36\lib\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.run
File "rknn\base\acuitylib\provider\text_provider.py", line 65, in rknn.base.acuitylib.provider.text_provider.TextProvider.get_batch
File "rknn\base\acuitylib\provider\base_provider.py", line 149, in rknn.base.acuitylib.provider.base_provider.BaseProvider._tensor_list_to_batch
File "C:\Users\dm\AppData\Roaming\Python\Python36\site-packages\numpy\core\_asarray.py", line 85, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: could not broadcast input array from shape (300,300,3) into shape (300,300)
E Catch exception when building RKNN model!
E Traceback (most recent call last):
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1356, in _do_call
E return fn(*args)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1341, in _run_fn
E options, feed_dict, fetch_list, target_list, run_metadata)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1429, in _call_tf_sessionrun
E run_metadata)
E tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
E (0) Out of range: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
E [[{{node fifo_queue_Dequeue}}]]
E (1) Out of range: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
E [[{{node fifo_queue_Dequeue}}]]
E [[fifo_queue_Dequeue/_1]]
E 0 successful operations.
E 0 derived errors ignored.
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 "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 950, in run
E run_metadata_ptr)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1173, in _run
E feed_dict_tensor, options, run_metadata)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1350, in _do_run
E run_metadata)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1370, in _do_call
E raise type(e)(node_def, op, message)
E tensorflow.python.framework.errors_impl.OutOfRangeError: 2 root error(s) found.
E (0) Out of range: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
E [[node fifo_queue_Dequeue (defined at D:\Program Files\Python\Python36\lib\site-packages\rknn\api\rknn.py:166) ]]
E (1) Out of range: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
E [[node fifo_queue_Dequeue (defined at D:\Program Files\Python\Python36\lib\site-packages\rknn\api\rknn.py:166) ]]
E [[fifo_queue_Dequeue/_1]]
E 0 successful operations.
E 0 derived errors ignored.
E Original stack trace for 'fifo_queue_Dequeue':
E File "to_rknn.py", line 204, in <module>
E ret = rknn.build(do_quantization=True, dataset='dataset.txt', rknn_batch_size=1)
E File "D:\Program Files\Python\Python36\lib\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 "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\ops\data_flow_ops.py", line 445, in dequeue
E self._queue_ref, self._dtypes, name=name)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\ops\gen_data_flow_ops.py", line 4503, in queue_dequeue_v2
E timeout_ms=timeout_ms, name=name)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
E op_def=op_def)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
E return func(*args, **kwargs)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
E op_def=op_def)
E File "D:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 2005, in __init__
E self._traceback = tf_stack.extract_stack()
export: ssd_mobilenet_v2.pb-def-quant.rknn ...
E RKNN model data is None, please load model first!
load rknn model failed
例子没测试通就放出来了么?
|
|