The Session graph is empty. Add operations to the graph before calling run().问题与
Could not load dynamic library ‘cudart64_101.dll’; dlerror: cudart64_101.dll not found问题解决方法
直接上代码:
import os # 导入顺序不要乱了!!!
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
v2 = tf.random.uniform((6, 6), minval=-0.5, maxval=0.5, dtype=tf.float32)
with tf.compat.v1.Session() as sess:
print(sess.run(v2))