text icon indicating copy to clipboard operation
text copied to clipboard

builtins.PermissionError: [Errno 13] Permission denied

Open LiangTiger opened this issue 6 years ago • 6 comments

❓ Questions and Help

Description

TEXT=torchtext.data.Field(lower=True)

train,test=torchtext.data.TabularDataset(path='data',train='train.csv',test='test.csv',format='csv',skip_header=True,fields=[('id',None),('keyword',None),('location',None),('text',TEXT),('target',None)])

error:

Traceback (most recent call last): File "F:/TF and Torch/kaggle2/kaggle2.py", line 16, in train,test=torchtext.data.TabularDataset(path='data',train='train.csv',test='test.csv',format='csv',skip_header=True,fields=[('id',None),('keyword',None),('location',None),('text',TEXT),('target',None)]) File "C:\Users\Tiger\AppData\Local\Programs\Python\Python37\Lib\site-packages\torchtext\data\dataset.py", line 251, in init with io.open(os.path.expanduser(path), encoding="utf8") as f: builtins.PermissionError: [Errno 13] Permission denied: 'data'

LiangTiger avatar Feb 13 '20 13:02 LiangTiger

@mttk Any ideas?

zhangguanheng66 avatar Feb 13 '20 15:02 zhangguanheng66

@mttk Any ideas?

Do you have any basic courses? I don't quite understand

LiangTiger avatar Feb 14 '20 01:02 LiangTiger

You can take a look at two tutorials: https://pytorch.org/tutorials/beginner/torchtext_translation_tutorial.html https://pytorch.org/tutorials/beginner/text_sentiment_ngrams_tutorial.html

zhangguanheng66 avatar Feb 14 '20 01:02 zhangguanheng66

@LiangTiger How did you solve thus problem? Thanks

rajan-blackboxes avatar Aug 21 '20 04:08 rajan-blackboxes

.data directory is created to save the downloaded data file. Please make sure you have the access to the directory or even the permission to create the folder.

zhangguanheng66 avatar Aug 21 '20 13:08 zhangguanheng66

You may want to use torchtext.data.TabularDataset.splits instead of torchtext.data.TabularDataset.

02w avatar Dec 08 '20 08:12 02w