Tensorflow tf.records with TypeError:只有长度为1的数组才能转换为Python标量

Tensorflow tf.records with TypeError:只有长度为1的数组才能转换为Python标量,tensorflow,Tensorflow,错误是:TypeError:只有length-1数组可以转换为Python标量 for i in range(0,len(ntest)): example = tf.train.Example( features=tf.train.Features( feature={ 'X': tf.train.Feature( float_list=tf.train.FloatList(value=[np.z

错误是:TypeError:只有length-1数组可以转换为Python标量

for i in range(0,len(ntest)):
    example = tf.train.Example(
        features=tf.train.Features(
          feature={
            'X': tf.train.Feature(
                float_list=tf.train.FloatList(value=[np.zeros((10,10))])),
            'uttid': tf.train.Feature(
                bytes_list=tf.train.BytesList(value=[ntest[i]])),
            'Y': tf.train.Feature(
                bytes_list=tf.train.BytesList(value=[TestTarget[i].eval(session=sess).tostring()]))}))
    serialized = example.SerializeToString()
    writer.write(serialized)

我没办法解决这个问题,串行数据的值只接受1-d np.ndarray,所以我只需要在1d数组中重塑值

我已经解决了,值只接受1-d np.ndarray,所以我只需要在(无)中重塑值,你能提供代码吗?
'X': tf.train.Feature(
                    float_list=tf.train.FloatList(value=[np.zeros((10,10))]))