• 陈浩然
    2019-01-15
    个人理解 :操作就是方法
     日常附代码
    import tensorflow as tf
    a = tf.constant(2)
    b = tf.constant(3)

    with tf.Session() as sess:
        print("a: %i:" % sess.run(a))
        print("b: %i:" % sess.run(b))
        print("Addition with constants : %i " % sess.run(a + b))
        print("Multiplication with constants : %i " % sess.run ( a * b))
    a: 2:
    b: 3:
    Addition with constants : 5
    Multiplication with constants : 6

    x = tf.placeholder( tf.int16 , shape= () , name = "x")
    y = tf.placeholder( tf.int16 , shape= () , name = "y")

    add = tf.add(x, y)
    mul = tf.multiply(x, y)
    ​

    with tf.Session() as sess:
        print("Addition with constants : %i" % sess.run (add , feed_dict = { x : 10 , y : 3}) )
        print("Multiplication with constants : %i " % sess.run (mul , feed_dict = { x : 3 , y : 7}))
    Addition with constants : 13
    Multiplication with constants : 21
    展开
    
     2
  • 段智华
    2019-01-15
    是指第三章以后的观看进度条显示0%。如果显示进度,下次可以接着从进度点继续学习。
    
     1
  • pyw
    2019-09-15
    x = tf.compat.v1.placeholder(tf.int16, shape=(), name="x")
    提示如下错误:
    tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'x' with dtype int16

    作者回复: 建议使用 TensorFlow 1.12/ 1.13 版本。

    这里的错误看下来是没有给 placeholder feed 对应数据格式的 数据

     1
    
  • 不瘦不改名
    2019-08-25
    老师我想问一下下面的代码运行的时候乘法计算的结果为什么是错的?结果总是x的值
    import tensorflow as tf

    x = tf.placeholder(tf.int16, shape=(), name="x")
    y = tf.placeholder(tf.int16, shape=(), name="y")
    add = tf.add(x, y)
    mul = tf.multiply(x, y)

    with tf.Session() as sess1:
        print("Addition with variables: %i" % sess1.run(add, feed_dict={x: 10, y: 5}))
        print("Multiplication with variable: %i" % sess1.run(mul, feed_dict={x: 3, y: 2}))
    展开
     1
    
  • 依然饭特稀
    2019-01-28
    定义占位符的时候,为什么要写一个shape(),这个参数不是要写一个函数吗?

    作者回复: 有 default value

    
    
  • 峻铭
    2019-01-17
    能自定义操作(函数)吗?课程里面看到的都是常规的加减乘除

    作者回复: 可以自定义 Op 的,请看官网https://www.tensorflow.org/guide/extend/op

    
    
我们在线,来聊聊吧