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

ValueError in my_txtutils.py #12

Open
yingdongucas opened this issue Jun 23, 2017 · 4 comments
Open

ValueError in my_txtutils.py #12

yingdongucas opened this issue Jun 23, 2017 · 4 comments

Comments

@yingdongucas
Copy link

yingdongucas commented Jun 23, 2017

When run rnn_train.py, I got the following error:

Traceback (most recent call last):
File "/tensorflow-rnn-shakespeare/rnn_train.py", line 148, in
txt.print_learning_learned_comparison(x, y, l, bookranges, bl, acc, epoch_size, step, epoch)
File "/tensorflow-rnn-shakespeare/my_txtutils.py", line 180, in print_learning_learned_comparison
footer = format_string.format('INDEX', 'BOOK NAME', 'TRAINING SEQUENCE', 'PREDICTED SEQUENCE', 'LOSS')
ValueError: Invalid conversion specification

I use Python 2.7.6 and tensorflow 1.1.0 on Ubuntu 14.04. How can I fix this? Any reply will be very much appreciated.

@martin-gorner
Copy link
Owner

This looks like a Python 2 / Python 3 discrepancy but theoretically "".format() works in Pyhon 2.7. i do not have an immediate answer. I will have to test under Python 2.7.6.

@mahmood431226
Copy link

Hi Martin
I study many script and code in tensorflow and python. It is obvious in all of them they use tf.reduce _mean() function after tf.nn.softmax_cross_entropy_with_logits to make loss but you don't, my question is Why????????

@hcchengithub
Copy link

see issue #15 , no problem on python3, windows 10, tensorflow 1.1.0.

@martin-gorner
Copy link
Owner

@mahmood431226 it is because on a mini-batch of input images, you get one loss per image. The loss is supposed to be a single scalar though so you average them.

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

No branches or pull requests

4 participants