tutorials
tutorials copied to clipboard
[BUG] - <title> TypeError when using len(train_dataloader.dataset) in Quickstart PyTorch tutorial
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
Both methods seem to work for me and return the same thing. Not sure if anything needs to be changed here cc: @albanD
Yes all seems to work for me as well. @hoangziet are you sure you didn't overwrite the variable or something like that?