1

I'm farmilliar with tf.train.Saver, which allows me to save variables to disk.

But is it possible to get them directly as a string? Or write them to an open stream? Something like:

binary_string_rep = saver.save(sess)
db.save(binary_string_rep)

Or do I have to write to disk, then read it back?

Dylan Harness
  • 719
  • 1
  • 9
  • 20

1 Answers1

1

You can convert any tensor to Numpy array. Then use Numpy array as you wish! for example your model has W_layer1 as weights for first layer. You can convert it to Numpy like : W_numpy = W_layer1.eval() which is mentioned also here: Tensor to Numpy array

Community
  • 1
  • 1
Alldb
  • 131
  • 8