While Running Pytorch Transfer learning tutorial I am getting following error.
Please tell the problem
Traceback (most recent call last):
  File "transfer_learning_tutorial.py", line 121, in <module>
    inputs, classes = next(iter(dset_loaders['train']))
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/data/dataloader.py", line 201, in __next__
    return self._process_next_batch(batch)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/data/dataloader.py", line 221, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/data/dataloader.py", line 40, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "build/bdist.linux-x86_64/egg/torchvision/datasets/folder.py", line 116, in __getitem__
    img = self.loader(path)
  File "build/bdist.linux-x86_64/egg/torchvision/datasets/folder.py", line 63, in default_loader
    return pil_loader(path)
  File "build/bdist.linux-x86_64/egg/torchvision/datasets/folder.py", line 45, in pil_loader
    with Image.open(f) as img:
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 528, in __getattr__
    raise AttributeError(name)
AttributeError: __exit__