Some tips about Tensorflow

Q: How to fix error report like

A: We can’t feed a value into a variable and optimize it in the same time (So the problem only occurs when using Optimizers). Should using ‘tf.assign()’ in graph to give value to tf.Variable

Q: How to get a tensor by name?

A: like this:

Q: How to get variable by name?

A:

2 Comments

    Himanshu

    Hey Robin, I am getting the first error that you mentioned about float_ref. My question is can I accept value into a placeholder using the feed dict and then assign that value to a variable ? This is because I want to have gradients wrt to the input (which I am passing into the placeholder) and for some restrictions I dont want to use embeddings. Thanks!

      RobinDong

      Hi Himanshu

      I think in Tensorflow we could accept value into a placeholder and then assign its value to a variable. The snippet below could work well:

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.