我们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
网友评论