TypeError: Failed to convert object of type < type ‘list’>to Tensor. Contents: [None, 9216]. Consider casting elements to a supported type.
在CNN卷积神经网络中,卷积层和全连接层进行连接时有个输入格式转换过程,即卷积层的输出是一个x*y*z的矩阵,而全连接层的输入是一个向量,需要把矩阵拉直成向量。我的程序中使用了如下代码:
# 卷积层9
weights9 = tf.get_variable('weights9', shape=[3, 3, 256, 256], dtype=tf.float32,
initializer=tf.contrib.layers.xavier_initializer(False))
conv9 = tf.nn.conv2d(actived_conv8, weights9, strides=[