Inside-Deep-Learning
Inside-Deep-Learning copied to clipboard
AttributeError in Chapter_2.ipynb
Hi,
when executing the 2nd cell:
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import *
from idlmam import *
I get this error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-376bfb908340> in <module>()
2 import torch.nn as nn
3 import torch.nn.functional as F
----> 4 from torch.utils.data import *
5 from idlmam import *
AttributeError: module 'torch.utils.data' has no attribute 'BatchSamplerDistributedSamplerDataset'
it is solved by importing only the used modules
from torch.utils.data import Dataset, DataLoader, TensorDataset
I'm not sure if it has something to do with my setup at Collab, but based on this post, it is related to version 1.7.0 of PyTorch
Thanks
Gah, 1.7.0 goofed a number of things I wrote before it was released. I'll close this when I revise the master copy of Chapter 2 (following order with editor - not ignoring). Appreciate the catch!