title: Exporting Outputs from a Neural Network
body: <p>I have built a neural network in Tensorflow and would like to export the output into a text file. The neural network for each example has two outputs probabilities. I would like to export these two rows of data into a text file but am having trouble doing that because as I run it I need to put it into some type of object and then am unable to export any of these object: for example:</p>
  
  <pre><code>m = []
  
  for (x, y) in test_dataset:
    logits = tf.nn.softmax(model(x))
    result_temp = np.asarray(logits)
    formatInt_temp = result_temp.astype(np.float)
    m.append(formatInt_temp)
  
  txt_file = open('testing.txt', 'w')
  
  txt_file.write(m)
  </code></pre>
  
  <p>The above code takes ndarrays and puts them into a list, originally I tried appending them to another ndarray but when I did that it gave me the error </p>
  
  <pre><code>AttributeError: 'numpy.ndarray' object has no attribute 'append'
  </code></pre>
  
  <p>A list was the only thing I could find I could export the ndarrays into. However once I have it in a list I can't export it because it must be exported as a string using the above method. If I then try putting that into a loop and exporting it one row at a time it says it can't export ndarrays like that. So does anyone know a better way of exporting the results of my model into a text file?</p>
  
  <p>Thanks</p>