如何修复“ PermissionError:[Errno 13]权限被拒绝:'TrainingImage \\。ipynb_checkpoints'”?

时间:2019-10-14 14:54:16

标签: python-3.x tkinter jupyter-notebook face-recognition

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\User\Anaconda3\lib\tkinter\__init__.py", line 1705, in 
__call__
return self.func(*args)
File "<ipython-input-36-16814cb75574>", line 9, in TrainImages
faces,Id = get Images And Labels("Training Image")
File "<ipython-input-37-be69fa84e663>", line 18, in getImage And Labels
pilImage=Image.open(imagePath).convert('L')
File "C:\Users\User\Anaconda3\lib\site-packages\PIL\Image.py", line 2770, 
in open
fp = builtins.open(filename, "rb")
PermissionError: [Errno 13] Permission denied: 'Training 
Image\\.ipynb_checkpoints'

我试图运行管理员模式,但是它不起作用

def TrainImages():

recognizer = cv2.face_LBPHFaceRecognizer.create()#recognizer = 
cv2.face.LBPHFaceRecognizer_create()#$cv2.createLBPHFaceRecognizer()

haar cascade Path = "haarcascade_frontalface_default.xml"

detector =cv2.CascadeClassifier(haar cascade Path)

faces,Id = get Images And Labels("Training Image")

recognizer.train(faces, np.array(Id))

recognizer.save("Training Image Label\Trainer.yml")

res = "Image Trained"#+",".join(str(f) for f in Id)

message.configure(text= res)

我收到.ipynb_checkpoints权限被拒绝的错误消息

0 个答案:

没有答案