title: TypeError: Input tensors to a Model must be Keras tensors. Found: Tensor("Placeholder_3:0", dtype=float32) (missing Keras metadata)
body: <p>my input variables</p>
  
  <pre><code>IMG_SIZE_PX=50
  SLICE_COUNT=20
  
  n_classes=2
  
  x=tf.placeholder('float')
  y=tf.placeholder('float')
  
  keep_rate=0.8
  keep_prob=tf.placeholder(tf.float32)
  </code></pre>
  
  <p>my convolution 3d function</p>
  
  <pre><code>def conv3d(x, W):
  return tf.nn.conv3d(x, W, strides=[1,1,1,1,1], padding='SAME')
  </code></pre>
  
  <p>my maxpooling 3d function</p>
  
  <pre><code>def maxpool3d(x):
  return tf.nn.max_pool3d(x, ksize=[1,2,2,2,1], strides=[1,2,2,2,1], 
  padding='SAME')
  </code></pre>
  
  <p>this is my network</p>
  
  <pre><code>def convolutional_neural_network(x):
  </code></pre>
  
  <p>my network weights</p>
  
  <pre><code>weights = {'W_conv1':tf.Variable(tf.random_normal([3,3,3,1,32])),
  
             'W_conv2':tf.Variable(tf.random_normal([3,3,3,32,64])),
              'W_fc':tf.Variable(tf.random_normal([ 54080 ,1024])),#here 54080 
  is the input tensor value
             'out':tf.Variable(tf.random_normal([1024, n_classes]))}
  </code></pre>
  
  <p>my network biases</p>
  
  <pre><code>biases = {'b_conv1':tf.Variable(tf.random_normal([32])),
             'b_conv2':tf.Variable(tf.random_normal([64])),
              'b_fc':tf.Variable(tf.random_normal([1024])),
             'out':tf.Variable(tf.random_normal([n_classes]))}
  </code></pre>
  
  <p>here is my input x</p>
  
  <pre><code>x = tf.reshape(x, shape=[-1, IMG_SIZE_PX, IMG_SIZE_PX, SLICE_COUNT, 1])
  </code></pre>
  
  <p>my 2 hidden layers(convolution+maxpooling)</p>
  
  <pre><code>conv1 = tf.nn.relu(conv3d(x, weights['W_conv1']) + biases['b_conv1'])
  conv1 = maxpool3d(conv1)
  conv2 = tf.nn.relu(conv3d(conv1, weights['W_conv2']) + biases['b_conv2'])
  conv2 = maxpool3d(conv2)
  </code></pre>
  
  <p>my fully connected layer</p>
  
  <pre><code> fc = tf.reshape(conv2,[-1,  54080 ])
  fc = tf.nn.relu(tf.matmul(fc, weights['W_fc'])+biases['b_fc'])
  fc = tf.nn.dropout(fc, keep_rate)
  </code></pre>
  
  <p>my output layer</p>
  
  <pre><code>output = tf.matmul(fc, weights['out'])+biases['out']
  return output
  </code></pre>
  
  <p>my input numpy arrays</p>
  
  <pre><code>much_data = np.load('D:/muchdata-50-50-20.npy')
  train_data = much_data[-10:]
  validation_data = much_data[-2:]
  </code></pre>
  
  <p>finally training my network</p>
  
  <pre><code> def train_neural_network(x):
   outl = convolutional_neural_network(x)#don't know this is my output 
  layer
   model=Model(input=x, output=outl)
   model.compile(optimizer='rmsprop',loss='categorical_crossentropy',metrics=
  ['accuracy'])
  train_neural_network(x)#train the net
  </code></pre>
  
  <p>my error is this<a href="https://i.stack.imgur.com/txZOF.jpg" rel="nofollow noreferrer">keras meta data is missing</a>
  any help can be appreciated</p>