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

How can i see the values, tf.log(predict_real + EPS) and tf.log(1 - predict_fake + EPS) ?? #152

Open
kycocotree opened this issue Nov 4, 2018 · 1 comment

Comments

@kycocotree
Copy link

@kycocotree kycocotree commented Nov 4, 2018

I want see the values while training, tf.log(predict_real + EPS) and tf.log(1 - predict_fake + EPS).
so, i'm add the code(#add code) in the main.

           if should(a.progress_freq):
                fetches["discrim_loss"] = model.discrim_loss
                fetches["gen_loss_GAN"] = model.gen_loss_GAN
                fetches["gen_loss_L1"] = model.gen_loss_L1
                fetches["predict_real"] = tf.log(model.predict_real + EPS)    #add code
                fetches["predict_fake"] = tf.log(1 - model.predict_fake + EPS)  #add code

            if should(a.progress_freq):
                # global_step will have the correct step count if we resume from a checkpoint
                train_epoch = math.ceil(results["global_step"] / examples.steps_per_epoch)
                train_step = (results["global_step"] - 1) % examples.steps_per_epoch + 1
                rate = (step + 1) * a.batch_size / (time.time() - start)
                remaining = (max_steps - step) * a.batch_size / rate
                print("progress  epoch %d  step %d  image/sec %0.1f  remaining %dm" % (train_epoch, train_step, rate, remaining / 60))
                print("discrim_loss", results["discrim_loss"])
                print("gen_loss_GAN", results["gen_loss_GAN"])
                print("gen_loss_L1", results["gen_loss_L1"])

                print("predict_real", results["predict_real"])      #add code
                print("predict_fake", results["predict_fake"])     #add code

but, this code is error...

Traceback (most recent call last):
File "pix2pix.py", line 809, in
main()
File "pix2pix.py", line 763, in main
fetches["predict_real"] = tf.log(model.predict_real + EPS) #add code
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\math_ops.py", line 850, in binary_op_wrapper
y = ops.convert_to_tensor(y, dtype=x.dtype.base_dtype, name="y")
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1011, in convert_to_tensor
as_ref=False)
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1107, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 217, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 202, in constant
name=name).outputs[0]
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3386, in create_op
self._check_not_finalized()
File "C:\Users\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 3024, in _check_not_finalized
raise RuntimeError("Graph is finalized and cannot be modified.")
RuntimeError: Graph is finalized and cannot be modified.

How can i see the values ???

@junyanz
Copy link
Collaborator

@junyanz junyanz commented Nov 5, 2018

You posted it to the wrong repo.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.