Toybrick

标题: 开启量化开关后模型转换报错; [打印本页]

作者: tof3d    时间: 2019-3-12 16:59
标题: 开启量化开关后模型转换报错;
本帖最后由 tof3d 于 2019-3-12 17:02 编辑



ret = rknn.build(do_quantization=True, dataset='./dataset.txt')


-> Loading model
done
--> Building model
E Catch exception when building RKNN model!
T Traceback (most recent call last):
T   File "rknn/api/rknn_base.py", line 470, in rknn.api.rknn_base.RKNNBase.build
T   File "rknn/api/rknn_base.py", line 888, in rknn.api.rknn_base.RKNNBase._quantize
T   File "rknn/base/rknnlib/app/tensorzone/quantization.py", line 248, in rknn.base.rknnlib.app.tensorzone.quantization.Quantization.run
T   File "rknn/base/rknnlib/app/tensorzone/quantization.py", line 110, in rknn.base.rknnlib.app.tensorzone.quantization.Quantization._run_quantization
T   File "rknn/base/rknnlib/app/tensorzone/workspace.py", line 167, in rknn.base.rknnlib.app.tensorzone.workspace.Workspace._setup_graph
T   File "rknn/base/rknnlib/app/tensorzone/workspace.py", line 168, in rknn.base.rknnlib.app.tensorzone.workspace.Workspace._setup_graph
T   File "rknn/base/rknnlib/app/tensorzone/graph.py", line 59, in rknn.base.rknnlib.app.tensorzone.graph.Graph.generate
T   File "rknn/base/rknnlib/rknnnetbuilder.py", line 108, in rknn.base.rknnlib.rknnnetbuilder.rknnNetBuilder.build
T   File "rknn/base/rknnlib/rknnnetbuilder.py", line 110, in rknn.base.rknnlib.rknnnetbuilder.rknnNetBuilder.build
T   File "rknn/base/rknnlib/rknnnetbuilder.py", line 134, in rknn.base.rknnlib.rknnnetbuilder.rknnNetBuilder.build_layer
T   File "rknn/base/rknnlib/rknnnetbuilder.py", line 134, in rknn.base.rknnlib.rknnnetbuilder.rknnNetBuilder.build_layer
T   File "rknn/base/rknnlib/rknnnetbuilder.py", line 134, in rknn.base.rknnlib.rknnnetbuilder.rknnNetBuilder.build_layer
T   [Previous line repeated 80 more times]
T   File "rknn/base/rknnlib/rknnnetbuilder.py", line 153, in rknn.base.rknnlib.rknnnetbuilder.rknnNetBuilder.build_layer
T   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 2156, in __enter__
T     return self._enter_scope_uncached()
T   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 2200, in _enter_scope_uncached
T     current_name_scope_name = current_name_scope.__enter__()
T   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5775, in __enter__
T     return self._name_scope.__enter__()
T   File "/usr/lib64/python3.6/contextlib.py", line 81, in __enter__
T     return next(self.gen)
T   File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3851, in name_scope
T     raise ValueError("'%s' is not a valid scope name" % name)
T ValueError: '_plus0_31' is not a valid scope name

  rknn.build(do_quantization=False)不会报错


模型类似mobilenet_v2



作者: seedlin    时间: 2019-3-13 09:09
scope name不能以下划线开头。开启量化以后,会用TensorFlow跑一遍模型,从日志上看应该是TensorFlow报错,所以模型可能存在一些问题。



作者: liuwenhua    时间: 2019-11-15 17:20
你问题解决了?




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3