我正在尝试在x_train中加载图像,但是却出现了一个没有此权限的错误。
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)
我遇到这种错误。
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'