Toybrick

楼主: LSC

asymmetric_quantized-u8量化问题

LSC

注册会员

积分
142
11#
 楼主| 发表于 2019-12-30 17:11:45 | 只看该作者
用了v1.3.0,还是会有同样的报错,不过错误多了一些信息
  1. D 196(3.94%), Queue size 0
  2. D 197(3.96%), Queue size 0
  3. D 198(3.98%), Queue size 0
  4. D 199(4.00%), Queue size 0
  5. E Catch exception when building RKNN model!
  6. Exception in thread Thread-1:
  7. Traceback (most recent call last):
  8.   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/threading.py", line 916, in _bootstrap_inner
  9.     self.run()
  10.   File "rknn/base/acuitylib/provider/queue_provider.py", line 98, in rknn.base.acuitylib.provider.queue_provider.QueueProvider.run
  11.   File "rknn/base/acuitylib/provider/queue_provider.py", line 102, in rknn.base.acuitylib.provider.queue_provider.QueueProvider.ru
  12.   File "rknn/base/acuitylib/provider/text_provider.py", line 65, in rknn.base.acuitylib.provider.text_provider.TextProvider.get_ba
  13.   File "rknn/base/acuitylib/provider/base_provider.py", line 163, in rknn.base.acuitylib.provider.base_provider.BaseProvider._tens_batch
  14.   File "rknn/base/acuitylib/provider/base_provider.py", line 105, in rknn.base.acuitylib.provider.base_provider.BaseProvider._reshs
  15.   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 292, in reshape
  16.     return _wrapfunc(a, 'reshape', newshape, order=order)
  17.   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
  18.     return getattr(obj, method)(*args, **kwds)
  19. ValueError: cannot reshape array of size 262144 into shape (1,512,512,3)

  20. E Traceback (most recent call last):
  21. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1292, in _do_ca
  22. E     return fn(*args)
  23. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1277, in _run_f
  24. E     options, feed_dict, fetch_list, target_list, run_metadata)
  25. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1367, in _call_run
  26. E     run_metadata)
  27. E tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requurrent size 0)
  28. E        [[{{node fifo_queue_Dequeue}} = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replicadevice:CPU:0"](fifo_queue)]]
  29. E During handling of the above exception, another exception occurred:
  30. E Traceback (most recent call last):
  31. E   File "rknn/api/rknn_base.py", line 737, in rknn.api.rknn_base.RKNNBase.build
  32. E   File "rknn/api/rknn_base.py", line 1644, in rknn.api.rknn_base.RKNNBase._quantize2
  33. E   File "rknn/base/RKNNlib/app/medusa/quantization.py", line 105, in rknn.base.RKNNlib.app.medusa.quantization.Quantization.run
  34. E   File "rknn/base/RKNNlib/app/medusa/quantization.py", line 44, in rknn.base.RKNNlib.app.medusa.quantization.Quantization._run_qn
  35. E   File "rknn/base/RKNNlib/app/medusa/workspace.py", line 135, in rknn.base.RKNNlib.app.medusa.workspace.Workspace.run
  36. E   File "rknn/base/RKNNlib/app/medusa/workspace.py", line 116, in rknn.base.RKNNlib.app.medusa.workspace.Workspace._run_iteration
  37. E   File "rknn/base/RKNNlib/RKNN_session.py", line 30, in rknn.base.RKNNlib.RKNN_session.RKNNSession.run
  38. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 887, in run
  39. E     run_metadata_ptr)
  40. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1110, in _run
  41. E     feed_dict_tensor, options, run_metadata)
  42. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1286, in _do_ru
  43. E     run_metadata)
  44. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1308, in _do_ca
  45. E     raise type(e)(node_def, op, message)
  46. E tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requurrent size 0)
  47. E        [[{{node fifo_queue_Dequeue}} = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replicadevice:CPU:0"](fifo_queue)]]
  48. E Caused by op 'fifo_queue_Dequeue', defined at:
  49. E   File "caffe2rknn.py", line 22, in <module>
  50. E     rknn.build(do_quantization=True, dataset='dataset.txt')
  51. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/rknn/api/rknn.py", line 238, in build
  52. E     ret = self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, pack_vdata=pre_compile, batch_size=rknn_batch_s
  53. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/ops/data_flow_ops.py", line 433, in dequ
  54. E     self._queue_ref, self._dtypes, name=name)
  55. 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
  56. E     timeout_ms=timeout_ms, name=name)
  57. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, op_helper
  58. E     op_def=op_def)
  59. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 488, in new_f
  60. E     return func(*args, **kwargs)
  61. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3272, in create_
  62. E     op_def=op_def)
  63. E   File "/home/lsc/anaconda3/envs/RKNN-130/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1768, in __init_
  64. E     self._traceback = tf_stack.extract_stack()
  65. E OutOfRangeError (see above for traceback): FIFOQueue '_0_fifo_queue' is closed and has insufficient elements (requested 1, curre
  66. E        [[{{node fifo_queue_Dequeue}} = QueueDequeueV2[component_types=[DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replicadevice:CPU:0"](fifo_queue)]]
  67. done
复制代码
回复

使用道具 举报

LSC

注册会员

积分
142
12#
 楼主| 发表于 2019-12-30 17:13:13 | 只看该作者
然后我预先把数据集的图片手动resize成输入尺寸512x512,再运行就成功了。
回复

使用道具 举报

LSC

注册会员

积分
142
13#
 楼主| 发表于 2019-12-30 22:03:08 | 只看该作者
然而调用这个模型时,在init_runtime这一步发生了段错误。
  1. >>> from rknn.api import RKNN
  2. >>> import cv2
  3. >>> import numpy as np
  4. >>> rknn = RKNN()
  5. >>> rknn_model = "../ctdet_coco_dlav0_1x_q2.rknn"
  6. >>> rknn.load_rknn(rknn_model)
  7. 0
  8. >>> rknn.init_runtime()
  9. Segmentation fault (core dumped)
复制代码
回复

使用道具 举报

jefferyzhang

版主

积分
13578
14#
发表于 2019-12-31 08:19:18 | 只看该作者
LSC 发表于 2019-12-30 22:03
然而调用这个模型时,在init_runtime这一步发生了段错误。

把pb原文件和转换脚本一起发给我,我转给NPU的同事debug
回复

使用道具 举报

LSC

注册会员

积分
142
15#
 楼主| 发表于 2019-12-31 08:48:31 | 只看该作者
jefferyzhang 发表于 2019-12-31 08:19
把pb原文件和转换脚本一起发给我,我转给NPU的同事debug

1.3.0版本会发生段错误,1.2.0不会,还是先继续用1.2.0吧
回复

使用道具 举报

jefferyzhang

版主

积分
13578
16#
发表于 2019-12-31 14:18:27 | 只看该作者
LSC 发表于 2019-12-31 08:48
1.3.0版本会发生段错误,1.2.0不会,还是先继续用1.2.0吧

嗯,这个段错误主要是因为1.3和你固件驱动不匹配,新版本固件我们下个月会发布
回复

使用道具 举报

LSC

注册会员

积分
142
17#
 楼主| 发表于 2019-12-31 14:59:24 | 只看该作者
jefferyzhang 发表于 2019-12-31 14:18
嗯,这个段错误主要是因为1.3和你固件驱动不匹配,新版本固件我们下个月会发布 ...

好的,感谢您的回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表