看以下两种不同的shape,解析得到的tensor的shape不同:
tf.FixedLenFeature(shape=[], dtype=tf.int64) # 解析得到的tensor的形状形如(bs, )
tf.FixedLenFeature(shape=[k], dtype=tf.int64) # 解析得到的tensor的形状形如(bs,k )
因此在解析样本数据时,特别要注意你要解析的tensor的形状,根据自己的需要填写k值。
本文探讨了TensorFlow中`tf.FixedLenFeature`解析时shape参数的重要性,介绍了如何根据需求设置形状,确保解析后的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值。
433
339
5590

被折叠的 条评论
为什么被折叠?
