Tensorflow lite debug过程

在将模型转换为TensorFlow Lite格式时,遇到了'None is only supported in the 1st dimension.'和'Some of the operators in the model are not supported...'的错误。这些问题可能源于输入形状设置、未安装的依赖库以及使用了TensorFlow Lite标准运行时不支持的运算。解决方案包括指定输入形状、考虑使用扩展运行时或自定义操作,并解决TensorFlow pip安装时的依赖问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错:None is only supported in the 1st dimension.

加入input_shapes={“input_1”:[1,600,500,3]}

import tensorflow as tf

graph_def_file = "./models/wdsr-a-32-x4-psnr-29.1736.pb"
input_arrays = ["input_1"]
output_arrays = ["lambda_5/add"]

converter = tf.lite.TFLiteConverter.from_frozen_graph(
  graph_def_file, input_arrays, output_arrays,input_shapes={"input_1":[1,600,500,3]})
tflite_model = converter.convert()
open("wdsr_-x4-converted_model.tflite", "wb").write(tflite_model)

Some of the operators in the model are not supported by the standard TensorFlow Lite runtime.

If those are native TensorFlow operators, you might be able to use the extended runtime by passing --enable_select_tf_ops, or

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值