Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Introductory CNN Model: TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64 #153

Open
femosh opened this issue Nov 13, 2018 · 0 comments

Comments

@femosh
Copy link

femosh commented Nov 13, 2018

This generate the TypeError:
full2_weight = tf.Variable(tf.truncated_normal([fully_connected_size1, target_size],
stddev=0.1, dtype=tf.float32))
full2_bias = tf.Variable(tf.truncated_normal([target_size], stddev=0.1, dtype=tf.float32))

target_size is wrong, it is 2.0 instead of 10 (9+1).
However, the problem originated from:
from tensorflow.examples.tutorials.mnist import input_data

Use this to fix the problem:
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
data_dir = 'temp'
mnist = input_data.read_data_sets(data_dir, one_hot=True)

data_dir = 'temp'
mnist = read_data_sets(data_dir)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant