TypeError: Failed to convert object of type class 'list' to Tensor. Contents: [Dimension(None), -1

问题:
TypeError: Failed to convert object of type to Tensor. Contents: [Dimension(None), -1]. Consider casting elements to a supported type.
TypeError: Failed to convert object of type class 'list' to Tensor. Contents: [Dimension(None), -1_第1张图片
解决方法:
tf.reshape(max_pool, [batch_num, -1])改为tf.layers.flatten(max_pool)
TypeError: Failed to convert object of type class 'list' to Tensor. Contents: [Dimension(None), -1_第2张图片

你可能感兴趣的:(Python)