Raise runtimeerror (‘the session graph is empty. Add operations to the ‘
RuntimeError: The Session graph is empty. Add operations to the graph before calling run().
This is when installing tensorflow, in order to test whether the installation is successful, and then use the online method, but there is an error when running the following code
import tensorflow as tf
import os
# os.environ [“TF_ CPP_ MIN_ LOG_ Level “] =’1 ‘# this is the default display level, displaying all information
os.environ [“TF_ CPP_ MIN_ LOG_ LEVEL”]=’2’
sess = tf.Session ()
a = tf.constant (2)
b = tf.constant (2)
print( sess.run (a+b))
At first, I suspected that my local problem, tensorflow, had not been completely downloaded. Later, baidu did not solve it. Then I thought whether there was an error in the installation process. The problem really lies here. After I created the tensorflow environment, I executed PIP install tensorflow The default download is version 2.0.0, but CONDA does not support it, so we need to see the tensorflow supported by CONDA before downloading
Version, execute the following command CONDA search — full – name tensorflow, as shown in the figure
Well, here we choose according to our Python version of tensorflow, and then execute
PIP install tensorflow = = 1. X.x
Read More:
- Monitoring session to determine whether the user is online or not
- [Solved] Multithreading uses jsch to obtain a session for connection error: session.connect: java.net.socketexception: connection reset
- Build a mybatis and it will appear session.selectOne Method error
- Non empty judgment method: the difference between isnotempty and isnotblank. isNullOrEmpty
- [Solved] Springcloud Add Eureka to Startup Error
- [Solved] Springboot uses redis to add LocaldateTime Java 8 error
- [Solved] Eclipse Update Error: An error occurred while uninstalling session context was…
- [Solved] Mybatis insert Error: Cause: java.sql.SQLException: SQL String cannot be empty
- JAVA: How to Solve Foreach Loop Remove/add Element Error
- Tensorflow Error TypeError: Fetch argument XXXX has invalid typeXXXX,must be a string or Tensor
- [Solved] asList().add() error: UnsupportedOperationException
- How to Solve ERROR: Java 1.7 or later is required to run Apache Drill
- [Solved] IDEA Add maven Project Error: Error:(3,21)java: Package javax.servletdoes not exist
- [Solved] Mybatis add dependencies Error: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration.
- Mongodb java version 3.X, prompt “XXX (an encryption algorithm) is not available” when there is a user name and password
- How to Solve Error: Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
- [Solved] Kafka Error: is/are not present and missingTopicsFatal is true
- [Solved] Java Error: Must declare a named package because this compilation unit is associated to the named module
- When the database table field is set to self incrementing, use the entity class to insert or update the data to solve the error (Hibernate Framework)
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime