- 博客(4)
- 收藏
- 关注
原创 TensorFlow2.x变量依赖创建时的注意问题
创建第一个变量之后,如果要根据第一个变量创建第二个变量,此时需要用到w1.initialized_value()这个属性,也就是w1初始化后的值# 创建第一个变量w1w1 = tf.compat.v1.Variable(tf.compat.v1.random_normal(shape=[10], stddev=0.5, seed=28, dtype=tf.float32), name='w1')# 基于第一个变量值创建的第二个变量,此时要用w1.initialized_value()a = t
2021-06-22 19:44:04 99
原创 RuntimeError: The Session graph is empty. Add operations to the......使用TensorFlow2.x报错
使用TensorFlow2.x运行sess.run()时,出现如下错误:RuntimeError: The Session graph is empty. Add operations to the graph before calling run().原因是TensorFlow1.x和TensorFlow2.x的语法不兼容解决方法如下:在引入代码所需要的包之后,紧跟着使用下列代码声明一下。tf.compat.v1.disable_eager_execution()...
2021-06-22 15:35:21 133
原创 使用TensorFlow2.x的一些注意
目前大多数视频教程和网络资源用的是TensorFlow1.x,从官网下载新版的TensorFlow之后有一些不兼容,下面是使用过程中一些笔记。一、创建对话(Session)TensorFlow1.x①sess = tf.Session()......sess.close()②# 代码中自动包含了sess.close()的功能,勿需另加with tf.Session as sess:TensorFlow2.x①sess = tf.compat.v1.Sessi
2021-06-22 14:12:27 371
原创 做回归分析时import ConvergenceWarning出错的问题
导入时出现下列问题FutureWarning: The sklearn.linear_model.coordinate_descent module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.linear_model. Anything that cann
2021-06-09 13:11:00 1151
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人