title: TensorFlow: AttributeError: 'dict' object has no attribute 'SerializeToString'
body: <p>In Tensorflow, I have set up a neural network as follows:</p>
  
  <pre><code>x = tf.placeholder(tf.float32)
  x_ = tf.placeholder(tf.float32)
  th = tf.placeholder(tf.float32)
  th_ = tf.placeholder(tf.float32)
  
  
  rlu_1 = tf.contrib.layers.fully_connected(inputs=tf.reshape([x,x_,th,th_],[1,4]),num_outputs=10)
  
  # 4 state features: x, x_, th, th_
  rlu_1.weights_initializer = tf.random_uniform(shape=[4],minval=-1,maxval=1) # is this 4 or 10?
  rlu_1.biases_initializer = tf.random_uniform(shape=[1],minval=-1,maxval=1)
  rlu_2 = tf.contrib.layers.fully_connected(inputs=rlu_1,num_outputs=10) # hope that makes a copy
  rlu_2.weights_initializer = tf.random_uniform(shape=[10],minval=-1,maxval=1)
  rlu_2.biases_initializer = tf.random_uniform(shape=[1],minval=-1,maxval=1)
  Qvals = tf.contrib.layers.fully_connected(inputs=rlu_2,num_outputs=2)
  Qvals.weights_initializer = tf.random_uniform(shape=[10],minval=-1,maxval=1)
  Qvals.biases_initializer = tf.random_uniform(shape=[1],minval=-1,maxval=1)
  Qvals.activation_fn = tf.identity
  
  
  xt = tf.placeholder(tf.float32)
  x_t = tf.placeholder(tf.float32)
  tht = tf.placeholder(tf.float32)
  th_t = tf.placeholder(tf.float32)
  
  # I build a separate copy of the network here, using [xt,x_t,tht and th_t] as inputs    
  </code></pre>
  
  <p>I use the following code to run a session:</p>
  
  <pre><code>observation = env.reset()
  observation = [float(i) for i in observation]
  prev_observation = observation
  #print(observation)
  reward = 1.0
  tfreward = tf.constant(reward, dtype=tf.float32)
  
  train_,nextAction = sess.run(train,tf.argmax(Qvals,0),
                                {x:prev_observation[0],x_:prev_observation[1],
                                th:prev_observation[2],th_:prev_observation[3],   
                                xt:observation[0],x_t:observation[1],
                                tht:observation[2],th_t:observation[3]})
  </code></pre>
  
  <p>The trouble is that I'm getting the following error at the final line of the code above:</p>
  
  <pre><code>  File "C:/Users/linna_t3vz49n/Documents/CS 486/a4/cartPole.py", line 236, in &lt;module&gt;
      tht:observation[2],th_t:observation[3]})
  
    File "C:\Users\linna_t3vz49n\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 783, in run
      compat.as_bytes(options.SerializeToString()))
  
  AttributeError: 'dict' object has no attribute 'SerializeToString'
  </code></pre>
  
  <p>How can I fix this?</p>