python
丸子的牛
这个作者很懒,什么都没留下…
展开
-
placeholder()
# coding = UTF-8import tensorflow as tf# placeholder理解为方法的形参,如要使用,必须传入参数x1 = tf.placeholder(dtype = tf.float32, shape = None)y1 = tf.placeholder(dtype = tf.float32, shape = None)z1 = x1 + y1x2 = tf.placeholder(dtype = tf.float32, shape = None)y2.原创 2021-04-07 20:30:05 · 275 阅读 · 0 评论 -
session()含义
import tensorflow as tfm1 = tf.constant([[2, 2]])m2 = tf.constant([[3], [3]])dot_operation = tf.matmul(m1,m2)sess = tf.Session()result = sess.run(dot_operation)print(result)with tf.Session() as sess: result_ = sess.run(do.原创 2021-04-07 17:00:42 · 100 阅读 · 0 评论 -
不能转换string到float
项目问题翻译过来是说不能把字符串转化为float。这里用到切片操作。首先,我打印出错的文件,然后将这个文件去掉,此时发生另一个文件错误。我找到了自己的公式错误,修改后。...原创 2021-04-03 11:00:43 · 906 阅读 · 0 评论