看以下两种不同的shape,解析得到的tensor的shape不同:
tf.FixedLenFeature(shape=[], dtype=tf.int64) # 解析得到的tensor的形状形如(bs, )
tf.FixedLenFeature(shape=[k], dtype=tf.int64) # 解析得到的tensor的形状形如(bs,k )
因此在解析样本数据时,特别要注意你要解析的tensor的形状,根据自己的需要填写k值。
看以下两种不同的shape,解析得到的tensor的shape不同:
tf.FixedLenFeature(shape=[], dtype=tf.int64) # 解析得到的tensor的形状形如(bs, )
tf.FixedLenFeature(shape=[k], dtype=tf.int64) # 解析得到的tensor的形状形如(bs,k )
因此在解析样本数据时,特别要注意你要解析的tensor的形状,根据自己的需要填写k值。