Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, architecture=[], d_hyperparams={}, meta_graph=None,
handles = self._buildGraph()
for handle in handles:
tf.add_to_collection(VAE.RESTORE_KEY, handle)
self.sesh.run(tf.initialize_all_variables())
self.sesh.run(tf.global_variables_initializer())

else: # restore saved model
model_datetime, model_name = os.path.basename(meta_graph).split("_vae_")
Expand All @@ -70,7 +70,7 @@ def __init__(self, architecture=[], d_hyperparams={}, meta_graph=None,
self.cost, self.global_step, self.train_op) = handles

if save_graph_def: # tensorboard
self.logger = tf.train.SummaryWriter(log_dir, self.sesh.graph)
self.logger = tf.summary.FileWriter(log_dir, self.sesh.graph)

@property
def step(self):
Expand Down Expand Up @@ -213,7 +213,7 @@ def train(self, X, max_iter=np.inf, max_epochs=np.inf, cross_validate=True,
verbose=True, save=True, outdir="./out", plots_outdir="./png",
plot_latent_over_time=False):
if save:
saver = tf.train.Saver(tf.all_variables())
saver = tf.train.Saver(tf.global_variables())

try:
err_train = 0
Expand Down