RuntimeError: The Session graph is empty. Add operations to the graph before calling run() #400
This above code is taken from Tensorflow Core r2.0 Document
RuntimeError: The Session graph is empty. Add operations to the graph before calling run()
The thing is
This gives the output without any errors
Hi @Krishnarohith10 , I tried following your approach, but still having the issue.
Please suggest on how to fix this.
Here is my code
hello_constant = tf.constant('Hello World!')
@HARIKABANDARU and also to everyone,
Ignore those messages those are because of the version of tensorflow, since we're using old version and also there been a lot changes to that version.
Now Unlike tensorflow=1.x, tensorflow=2.x has tf.executing_eagerly()-->True which means we no need to use tf.Session(), tf.Session() is only meant for if tf.executing_eagerly()-->False, which in case of tensorflow=1.x, but as tensorflow=2.x is True for tf.executing_eagerly(), we don't need to use it. We can surely omit that statement and can do your coding or projects. Have a look:
and if we want the result or value of your output variable we can access it by using .numpy()
Here it is! That's all I wanted to say, and everyone please update your working libraries like tensorflow or anyother librabries to the latest version so that we don't wanna stay behind the world, do we? And I myself with the latest versions of machine-learning and deep-learning libraries working on few projects, because I wanted to work or get a job in this A.I domain. This is a little background of me to you. I been dealing with this libraries pretty much years till now, still even I got few issues which can't solve but anyways. If any queries please don't hesitate to ask regarding tensorflow, please! And @HARIKABANDARU Please try just doing this with your project or If you give me data or If it available online then I can tell test it myself and tell you the results if not you can try your own.