美文网首页
查看Dataloader object里的内容

查看Dataloader object里的内容

作者: KK_f2d5 | 来源:发表于2023-11-19 15:15 被阅读0次

我们load了一个data iter后,怎么知道里面的内容呢?
一个方法:

next(iter(data_iter))

另一个方法:

for data in dataloader:
    # process your data
    print(data)

需要知道它们的shape怎么办呢:

for data in train_iter:
    print(data)  # To understand the structure
    # If data is a tuple like (features, labels), you can print their shapes individually
    features, labels = data
    print(features.shape, labels.shape)
    break

相关文章

网友评论

      本文标题:查看Dataloader object里的内容

      本文链接:https://www.haomeiwen.com/subject/hflmwdtx.html