rknn-tookit使用笔记

转换caffe模型出错: has no attribute ‘const_data’

报错信息:

AttributeError: 'NoneType' object has no attribute 'const_data'

通过不断删除prototxt文件里的节点,定位到是Scale的问题。和其他scale算子的差别只是加了filler。具体原因不清楚。

layer {
  name: "block35_1/Scale"
  type: "Scale"
  bottom: "block35_1/Conv2d_1x1"
  top: "block35_1/Scale"
  scale_param {
    filler {
      value: 0.xx
    }
  }
}

解决办法只是换到tensorflow模型。

转换caffe模型出错:Unknown caffe layer

还是转换caffe模型出的问题。解决办法还是使用tensorflow模型替换。
在这里插入图片描述

有些模型对于转换模型时的database.txt很敏感

有个别模型对database.txt很敏感,需要设置一些典型的图片,否则量化后出的结果不准(奇怪的是非量化的模型受的影响很小)

手动转换tensorflow的ckpt文件到pb文件出错

报错信息:

module 'tensorflow._api.v2.train' has no attribute 'import_meta_graph'

解决方法:

import tensorflow.compat.v1 as tf

手动转换tensorflow的ckpy文件到pb文件出错:No graph exists when eager execution is enabled

报错信息:

 File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/training/saver.py", line 1459, in _import_meta_graph_with_return_elements
    raise RuntimeError("Exporting/importing meta graphs is not supported when "
RuntimeError: Exporting/importing meta graphs is not supported when eager execution is enabled. **No graph exists when eager execution is enabled**.

解决办法:

tf.disable_eager_execution()

(来自:https://github.com/tensorflow/hub/issues/350

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值