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

had to add line to file to get model accuracy. must be better way. #3

mariochampion opened this Issue Dec 20, 2017 · 1 comment


None yet
1 participant
Copy link

mariochampion commented Dec 20, 2017

fully acknowledging it is not a best practice, i added a line to tensorflow's script because i could not get stdout=subprocess.PIPE or any close permutation to work. and although tf.logging says it prints to stdout, there is an github issue that disputes that, along with stackexchange conversation and my experience.

See tensorflow/tensorflow#3047

therefore, the add_accuracy_to_modeldir() function in relies on pulling the model accuracy from the "retrained_labels.txt" file generated at the end of tensorflow's retraining. i glommed onto that file creation to add accuracy to a line at the end of that file, then use add_accuracy_to_modeldir() to grab it, and delete it from the file.

the added line is literally the last line in's main() function. around line 1144 i added:

f.write(str("_acc"+str(test_accuracy*100)[:5]) + '\n')

BUT I WOULD LOVE to just grab it from and/or stdout or anything that doesnt require a change to a file i didnt create...

suggestions welcomed!!


This comment has been minimized.

Copy link

mariochampion commented Feb 2, 2018

resolved!! see pr #31
and comment about stderr not stdout.. bam!
training_results = Popen(cmds,shell=False,stderr=PIPE,bufsize=1,executable="python")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment