我們load了一個(gè)data iter后扬霜,怎么知道里面的內(nèi)容呢?
一個(gè)方法:
next(iter(data_iter))
另一個(gè)方法:
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