Skip to content

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

Description

@femosh

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions