This is the code, and when I ran it I got the below NotADirectoryError. I tried to replace the directory but I got the same error. Can someone please help me to solve the issue.
Code:
import os
img_path = os.path.join(os.getcwd(), "Recog_Train")
class_names = []
for subdir in os.listdir(img_path):
path = img_path + '/' + subdir
path = path + '/'
for img in os.listdir(path):
img_pic = path + img
class_names.append(subdir)
Error:
PS C:\masksdetection-master> python -u "c:\masksdetection-master\Face_recog.py"
2022-04-18 16:23:22.527773: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-04-18 16:23:22.537982: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "c:\masksdetection-master\Face_recog.py", line 33, in <module>
for img in os.listdir(path):
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\masksdetection-master//Recog_Train/.DS_Store/'
Eventually I would like to process these images with OpenCV and Tensorflow.