I'm trying to create deep learning model to detect "Face" in the images. I'm in the beginning phase and I'm facing an issue when I load my images.
I wish someone can support with solving this error
import os
import time
import uuid
import tensorflow as tf
import cv2
import json
import numpy as np
import matplotlib.pyplot as plt
IMAGES_PATH = os.path.join('data','images')
number_images = 30
images_path ="File\\path\\data\\images"
## Review Dataset and build image loading function
import tensorflow as tf
import json
import numpy as np
from matplotlib import pyplot as plt
# Avoid OOM errors by setting GPU Memory Consumption Growth
gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
tf.config.list_physical_devices('GPU')
\#Load Image into TF Data Pipeline
\#images = tf.data.Dataset.list_files('data\\images\\\*.jpg')
images = tf.data.Dataset.list_files('C:\\file\\path\\data\\images')
images.as_numpy_iterator().next()
def load_image(x):
byte_img = tf.io.read_file(x)
img = tf.io.decode_jpeg(byte_img)
return img
images = images.map(load_image)
#When I run the below I get a access denied error
images.as_numpy_iterator().next()`\`
`UnknownError: {{function_node __wrapped__IteratorGetNext_output_types_1_device_/job:localhost/replica:0/task:0/device:CPU:0}} NewRandomAccessFile failed to Create/Open: C:\Users\M004955\Desktop\PythonProjects\testProjects\DetectionModel\data\images : Access is denied. ; Input/output error [[{{node ReadFile}}]] [Op:IteratorGetNext] name:
I tried :
- Run as administrator
- File permission seems normal