tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

[BUG] - <title> TypeError when using len(train_dataloader.dataset) in Quickstart PyTorch tutorial

Open hoangziet opened this issue 10 months ago • 2 comments

Add Link

https://pytorch.org/tutorials/beginner/basics/quickstart_tutorial.html

Describe the bug

When using len(train_dataloader.dataset) to get the dataset size in the Google Colab notebook from Quickstart PyTorch, I encountered the following error:

TypeError: 'FashionMNIST' object is not callable

I think we can use another way to take the size we need:

train_dataloader.dataset.data.shape[0]
```

### Describe your environment

Google Colab
Torch version: 2.5.1+cu121

cc @subramen @albanD @jbschlosser

hoangziet avatar Jan 10 '25 08:01 hoangziet