NVIDIA / sentiment-discovery

Unsupervised Language Modeling at scale for robust sentiment classification
Other
1.06k stars 202 forks source link

"AttributeError: 'DataLoader' object has no attribute '_dataset_kind'" How should I solve this error? #73

Closed ArronChan closed 4 years ago

ArronChan commented 4 years ago

I downloaded the pretrained model "Finetuned Plutchik Transformer [673MN]", and put it in the root directory. And then I run the run_classifier.py with following instruction to reproduce the sentiment classification results: python run_classifier.py --model transformer --load transformer_semeval.clf --data ./data/semeval/train.csv --valid ./data/semeval/val.csv --test ./data/semeval/test.csv --text-key Tweet However, Error I can't fix showed up. Traceback (most recent call last): File "run_classifier.py", line 244, in <module> 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\Arron\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 279, in __iter__ return _MultiProcessingDataLoaderIter(self) File "C:\Users\Arron\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 677, in __init__ super(_MultiProcessingDataLoaderIter, self).__init__(loader) File "C:\Users\Arron\Anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 326, in __init__ self._dataset_kind = loader._dataset_kind AttributeError: 'DataLoader' object has no attribute '_dataset_kind'

Please help me. Hope for your answer.

imomayiz commented 4 years ago

That must be related to your pytorch version

ArronChan commented 4 years ago

@imomayiz Yeah, I install torch==1.0.1 torchvision==0.2.2 and finally it works, thank you!