AttributeError: 'DataLoader' object has no attribute '_dataset_kind'

Hi,

I am currently using Python 3.7, and installed with:
python -m pip install torch==1.3.0 torchvision==0.4.1 -f https://download.pytorch.org/whl/torch_stable.html --user

When i tried to run a github repo, I get the error:

AttributeError: ‘DataLoader’ object has no attribute ‘_dataset_kind’

This happens in dataloader.py:
Specifically:

Traceback (most recent call last):
File “run_classifier.py”, line 244, in
main()
File “run_classifier.py”, line 226, in main
ypred, yprob, ystd = classify(model, train_data, args)
File “run_classifier.py”, line 139, in classify
for i, data in tqdm(enumerate(text), total=len(text)):
File “C:\Users\Koh Ling Ping\AppData\Roaming\Python\Python37\site-packages\torch\utils\data\dataloader.py”, line 278, in iter
return _MultiProcessingDataLoaderIter(self)
File “C:\Users\Koh Ling Ping\AppData\Roaming\Python\Python37\site-packages\torch\utils\data\dataloader.py”, line 636, in init
super(_MultiProcessingDataLoaderIter, self).init(loader)
File “C:\Users\Koh Ling Ping\AppData\Roaming\Python\Python37\site-packages\torch\utils\data\dataloader.py”, line 303, in init
self._dataset_kind = loader._dataset_kind
AttributeError: ‘DataLoader’ object has no attribute ‘_dataset_kind’

I tried to switch torch versions 1.2.0 and 1.1.0, and torchvision versions as well. Can someone advise on this issue?

Hi,

Can you verify that your dataloader properly calls super().__init__() during its initialization?
It looks like some fields that are populated during the DataLoader class initialization are not set in your case.

Have you found a solution yet ? I ran into the same trouble while running NVIDIA/sentiment-discovery

@kaushil24 Did you try this?