解决‘tf.ResizeNearestNeighbor‘ op is neither a custom op nor a flex op

解决'tf.ResizeNearestNeighbor' op is neither a custom op nor a flex op

将tensorflow模型转换为TFlite模型:参考个人博客https://panjinquan.blog.csdn.net/article/details/107231435 ,其中可能会出现转换错误:网络

'tf.ResizeNearestNeighbor' op is neither a custom op nor a flex op
<unknown>:0: error: failed while converting: 'main': Ops that can be supported by the flex runtime (enabled via setting the -emit-select-tf-ops flag): ResizeNearestNeighbor.
测试

 自从Tensorflow更新到2.0后,我就发现几乎每一个版本的都有细微的差别问题,出现这个错误,多是因为的网络层添加UpSampling2D这些上采样层,但TFlite是支持UpSampling2D操做的.flex

 我能够很负责任的告诉你,这多是训练模型的版本,跟你测试的版本不一致致使的,好比当你用TF2.0进行模型训练时,在TF2.2进行TFlite转换,就可能出现这个错误,你须要保证训练和转换TFLite的版本一致便可spa

相关文章
相关标签/搜索