转换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()