报错: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 by setting target_ops=TFLITE_BUILTINS,SELECT_TF_OPS when calling tf.lite.TFLiteConv
解决TensorFlow Lite运行时不支持的操作问题

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

942





