Toybrick

开启量化开关后模型转换报错;

tof3d

中级会员

积分
210
楼主
发表于 2019-3-12 16:59:17    查看: 8274|回复: 2 | [复制链接]    打印 | 只看该作者
本帖最后由 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

注册会员

积分
54
沙发
发表于 2019-3-13 09:09:28 | 只看该作者
scope name不能以下划线开头。开启量化以后,会用TensorFlow跑一遍模型,从日志上看应该是TensorFlow报错,所以模型可能存在一些问题。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

liuwenhua

中级会员

积分
378
板凳
发表于 2019-11-15 17:20:38 | 只看该作者
你问题解决了?
回复

使用道具 举报

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

本版积分规则

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


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