Linked Questions

Popular Questions

I am trying to load images in x_train, but I am getting an error of not having permission for this.

import keras
import tensorflow as tf

train_path = open('C:/Users/dwika/Desktop/catdog/data/train', 'rb')
x_train = []
test_path = open('C:/Users/dwika/Desktop/catdog/data/test', 'rb')
x_test = []

for img in train_path:
    img_path = train_path + img
    x = keras.preprocessing.image.load_img(img_path)
    x_train.append(x)

for img in test_path:
    img_path = test_path + img
    x = keras.preprocessing.image.load_img(img_path)
    x_test.append(x)

I am getting this type of error.

 Using TensorFlow backend.
 Traceback (most recent call last):
 File "C:/Users/dwika/Desktop/catdog/catdog.py", line 4, in <module>
 train_path = open('C:/Users/dwika/Desktop/catdog/data/train', 'rb')
 PermissionError: [Errno 13] Permission denied:'C:/Users/dwika/Desktop/catdog/data/train'

Related Questions