Skip to content

Ch02 concept 6 Saving variable #20

@boloson

Description

@boloson

saver.save(sess, "spikes.ckpt") doesn't work

require running tf.global_variables_initializer() for newer version of Tensorflow

sess = tf.InteractiveSession()
init = tf.global_variables_initializer()
sess.run(init)

raw_data = [1., 2., 8., -1., 0., 5.5, 6., 13]
spikes = tf.Variable([False] * len(raw_data), name='spikes')
spikes.initializer.run()

saver = tf.train.Saver()

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