Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix facenet.get_learning_rate_from_file() #884

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BaeMinCheon
Copy link

I expected when learning rate becomes -1, the train is closed
but get_learning_rate_from_file() returns nonetype whenever learning rate becomes -1
( other users have this problem, too : #853 )
it is the problem, and I modified the function so that solve the problem

images below show the different results

before:
01

after:
02

xunings added a commit to xunings/facenet that referenced this pull request Apr 17, 2019
@hsm4703
Copy link

hsm4703 commented Jul 10, 2019

回溯(最近一次調用最後一次):
文件“src / train_softmax.py”,第580行,在
main(parse_arguments(sys.argv [1:]))
文件“src / train_softmax.py”,第234行,在主要的
prelogits中, prelogits_center_loss,args.random_rotate,args.random_crop,args.random_flip,prelogits_norm,args.prelogits_hist_max,args.use_fixed_image_standardization)
文件“SRC / train_softmax.py”,線306,在列車
LR = facenet.get_learning_rate_from_file(learning_rate_schedule_file,歷元)
文件“ C:\ facenet-master \ src \ facenet.py“,第295行,在get_learning_rate_from_file中
e = int(par [0])
ValueError:對於帶有基數為10的int()的無效文字:''
e = int(par[0]) this way how can i fix
i change code and use your code but i have this problem can u fix it ?

@BaeMinCheon
Copy link
Author

can i get the error message written with english ? i can hardly know about the error

@hsm4703
Copy link

hsm4703 commented Jul 10, 2019

Backtracking (last call last time):
The file "src / train_softmax.py", line 580, at
Master (parse_arguments(sys.argv [1:]))
File "src / train_softmax.py", line 234, in the main
In prelogits, prelogits_center_loss, args.random_rotate, args.random_crop, args.random_flip, prelogits_norm, args.prelogits_hist_max, args.use_fixed_image_standardization)
File "SRC / train_softmax.py", line 306, on the train
LR = facenet.get_learning_rate_from_file(learning_rate_schedule_file , epoch)
The file "C:\facenet-master \ src \ facenet.py", line 295, in get_learning_rate_from_file
e = int(par [0])
ValueError: Invalid text for int() with a base of 10: ''
e = int(par [0]) so how can I fix it?
I changed the code and used your code but can I fix it with this problem?
i am taiwanese sry

@BaeMinCheon
Copy link
Author

BaeMinCheon commented Jul 11, 2019

you should check out a value that the par[0] has when the error occurs. use print() or watch for debugging it.

it seems that the error occurs when the par[0] is not in the format of integer (ex: '' , '123.456' ...etc)

if the par[0] contains the value not in the format of integer, it would be good to check out the learning rate file. in any case, your learning rate file may have contained unnecessary lines or characters.

p.s. you do not have to be sorry about the language. but it would be better sharing codes in english especially on github for saving a conversation cost.

@hsm4703
Copy link

hsm4703 commented Jul 12, 2019

you should check out a value that the par[0] has when the error occurs. use print() or watch for debugging it.
e = print(int(par[0])) like it or how do i change code?

@hsm4703
Copy link

hsm4703 commented Jul 12, 2019

Learning rate schedule

Maps an epoch number to a learning rate 0: 0.05 60: 0.005 80: 0.0005 91: -1

my learning rate classifier_casia file may have contained unnecessary lines or characters?

@BaeMinCheon
Copy link
Author

create a repository with your code on github and let me know the url of the repository. then, I can check out what is the matter.

@hsm4703
Copy link

hsm4703 commented Jul 16, 2019

create a repository with your code on github and let me know the url of the repository. then, I can check out what is the matter.

https://github.com/hsm4703/facenet/blob/master/softmax.py

@BaeMinCheon
Copy link
Author

BaeMinCheon commented Jul 17, 2019

I have reproduced your error. the error seems to happen because of the learning rate file. look at the screenshots below.

#1 : if it does not contain any unnecessary line
image

#2 : if it contains one unnecessary line
image

#3 : if it contains two unnecessary lines
image

therefore, you should check out whether your learning rate file contains more than one unnecessary line. and I made PR about it, so you can do this for ease, too.

@hsm4703
Copy link

hsm4703 commented Jul 18, 2019

我已經復制了你的錯誤。由於學習率文件,似乎發生了錯誤。看下面的截圖。

#1:如果它不包含任何不必要的行
圖片

#2:如果它包含一條不必要的行
圖片

#3:如果它包含兩個不必要的行
圖片

因此,您應該檢查您的學習率文件是否包含多個不必要的行。我做了關於它的PR,所以你也可以輕鬆做到這一點。
1563416036518

thank you begin i use note so i don't see contains more than one unnecessary line. but i use sublime or your notepad++ i find have three unnecessary line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants