# TensorFlow : train.restore

**URL:** <https://discourse.julialang.org/t/tensorflow-train-restore/5948>\
**Category:** Machine Learning\
**Tags:** tensorflow\
**Created:** [September 18, 2017, 3:00pm UTC](https://discourse.julialang.org/t/tensorflow-train-restore/5948 "2017-09-18T15:00:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [September 18, 2017, 3:00pm UTC](https://discourse.julialang.org/t/tensorflow-train-restore/5948/1 "2017-09-18T15:00:35Z")

</div>

I’m trying to familiarize with the sample code which runs correctly.  
There is a line in the epoch iteration train.save(…) which saves a number of binary files labelled from 95 to 99. I understand that they can be recovered with train.restore() but I have not been able to read them.  
It’s quite possible these are not meant for diagnostic (human reading) purposes, just for internal use?

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [September 18, 2017, 3:16pm UTC](https://discourse.julialang.org/t/tensorflow-train-restore/5948/2 "2017-09-18T15:16:46Z")

</div>

Docs for saving and restoring are here.  
[http://malmaud.github.io/TensorFlow.jl/latest/saving.html](http://malmaud.github.io/TensorFlow.jl/latest/saving.html)

They should be correct and clear,  
If not please raise and issue in the repository.

The reason they are numbers is because:

> save can be passed a global\_step keyword parameter, which is an integer that will be suffixed to the variable file name. The Saver constructor accepts an optional max\_to\_keep argument, which is an integer specifying how many of the latest versions of the variable files to save (older ones will be discarded to save space) …  
> By the end of this loop, file “variable\_file\_95” contains the variable values during the 95th iteration, “variable\_file\_96” the 96th iteration, etc

They are in the JLD/HDF5 file format.  
They are not readable.  
You can read them with JLD.jl,  
or with hdf5tools.

They are not exactly intended for that though, they should be read by loading them into a graph.

If you want to use things for diagnostic purposes use tensorboard.  
[See these docs.](http://malmaud.github.io/TensorFlow.jl/latest/visualization.html)

---

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [September 18, 2017, 3:33pm UTC](https://discourse.julialang.org/t/tensorflow-train-restore/5948/3 "2017-09-18T15:33:45Z")

</div>

Excellent, thanks, I was trying to make sense of the main TensorFlow docs which are harder to read.
