seathiefwang / FaceRecognition-tensorflow

基于TensorFlow训练的人脸识别神经网络
1.31k stars 414 forks source link

when I run IS_MY_FACE #11

Open yangyangwill opened 6 years ago

yangyangwill commented 6 years ago

File "G:/pycharm/untitled1/venv/is_my_face.py", line 145, in saver.restore(sess, tf.train.latest_checkpoint('.')) File "G:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 1751, in restore raise ValueError("Can't load save_path when it is None.") ValueError: Can't load save_path when it is None.

How to tackle this problem? Thanks!

GrinHHH commented 6 years ago

I have this problem too,but what is wrong is in file "train_faces", after running that file you didn`t get the savepath,you could change the code like this: saver.save(sess, './train_faces.model', global_step=n*num_batch+i) sys.exit(0) print ('saver done') and you will see if u have generate the path.
if you find a way to solve(or to say generate the path),plz tell me ,thanks!

sorry ,i make a mistake here. you should put the "print"before the function exit,or you won`t see the result either

KalElSuper commented 6 years ago

I have this problem too?Have you solved this problem?Please reply me,thank you!

GrinHHH commented 6 years ago

I ... emmm,delete the “if ”sentence at the end of the code,for that avoid me from generating the path...but i dont know why.there should be some reason in that sentence but i cant understand.You can try this way,but its not a good way to solve the prolem.

KalElSuper commented 6 years ago

Excuse me, can you explain it clearly? Which "if" should I remove?

GrinHHH commented 6 years ago

remove line 163,

if (n*num_batch+i) % 100 == 0

(i forget if this is the origin code,for i had changed it once)

and you could change the print in 161 and 166 to

`print(n*num_batch+i,loss,'loss')

print(n*num_batch+i,acc,'acc') `

then,if the acc>0.98,you will get the path

KalElSuper commented 6 years ago

That's great, this is working, thank you!

yangyangwill commented 6 years ago

Thank you, but when I run this program if I use the other people's faces it will also terms out 'True' Do you know why? Thank you so much!

hbkcy commented 6 years ago

为什么按照楼上的方法,我没能得到解决

zzzzjinxiang commented 6 years ago

you don't have enough samples. Acc can't reach 0.95