matroid / dlwithtf

TensorFlow for Deep Learning Book
http://shop.oreilly.com/product/0636920065869.do
321 stars 160 forks source link

Different bug in Ch. 3 linear regression code #21

Open jbielski opened 4 years ago

jbielski commented 4 years ago

Hi, When I run this code, I get this error: InvalidArgumentError: You must feed a value for placeholder tensor 'placeholders6/Placeholder' with dtype float and shape [100,1] at this line: , summary, loss = sess.run([train_op, merged, l], feed_dict=feed_dict)

My hunch is that it's because this line: x_np = np.random.rand(N, 1)

creates integers rather than floats.

I'm using Python 2.7.6 and tensorflow 2.0.0 but I import TensorFlow like this: import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

rbharath commented 4 years ago

@jbielski We've only tested this codebase on TF 1.x. Could you try installing TF 1.15 and seeing if it works for you?