这个错误通常是因为函数需要的是一个Tensor对象,但是传递给函数的却是一个Tensor列表。可以尝试修改代码,将x变成单个的Tensor对象,而不是列表。例如:

x = tf.constant(x, dtype=tf.float32)

或者

x = tf.convert_to_tensor(x, dtype=tf.float32)

x = tfconstantxx是Tensorencoder_3BiasAdd0 shape=None 10 dtype=float32 报错TypeError List of Tensors when single Tensor expected如何解决

原文地址: https://www.cveoy.top/t/topic/bKXT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录