matroid / matroid/dlwithtf

Different bug in Ch. 3 linear regression code

Open
#21 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
322
Forks
155
PR merge metrics
No merged PRs in 30d

Description

Hi,
When I run this code, I get this error:
InvalidArgumentError: You must feed a value for placeholder tensor 'placeholders_6/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()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Chapter 3 linear regression code and reproduce the reported sess.run call using the stated Python 2.7.6 and TensorFlow 2.0.0 compatibility setup. Trace the placeholder defined for shape [100,1] and the feed_dict supplied to the training step; done means the training loop runs without the missing-placeholder error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.