Ask Your Question

Revision history [back]

I'm facing "[Errno 13] Permission denied" error can any one help

the full error message is : PermissionError: [Errno 13] Permission denied: 'F:/PetImages/train/Dog'

and the code is :

train_dir = 'F:/PetImages/train' test_dir = 'F:/PetImages/test'

train_dogs = ['F:/PetImages/train/{}'.format(i) for i in os.listdir(train_dir) if 'Dog' in i] train_cats = ['F:/PetImages/train/{}'.format(i) for i in os.listdir(train_dir) if 'Cat' in i]

test_img = ['F:/PetImages/test/{}'.format(i) for i in os.listdir(test_dir)]

train_imgs = train_dogs[:200] + train_cats[:2000]

random.shuffle(train_imgs)

import matplotlib.image as mpimg for ima in train_imgs[0:3]: img = mpimg.imread(ima) imgplot = plt.imshow(img) plt.show()

I'm facing "[Errno 13] Permission denied" error can any one help

the full error message is : PermissionError: [Errno 13] Permission denied: 'F:/PetImages/train/Dog'

and the code is :

train_dir = 'F:/PetImages/train'
test_dir = 'F:/PetImages/test'

'F:/PetImages/test'

train_dogs = ['F:/PetImages/train/{}'.format(i) for i in os.listdir(train_dir) if 'Dog' in i] train_cats = ['F:/PetImages/train/{}'.format(i) for i in os.listdir(train_dir) if 'Cat' in i]

i]

test_img = ['F:/PetImages/test/{}'.format(i) for i in os.listdir(test_dir)]

os.listdir(test_dir)]

train_imgs = train_dogs[:200] + train_cats[:2000]

train_cats[:2000] random.shuffle(train_imgs)

random.shuffle(train_imgs)

import matplotlib.image as mpimg for ima in train_imgs[0:3]: img = mpimg.imread(ima) imgplot = plt.imshow(img) plt.show()

plt.show()