Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes 1st time when loss output is reached and cannot restore from last model #2

Open
hofpcp opened this issue Jul 26, 2018 · 2 comments

Comments

@hofpcp
Copy link

hofpcp commented Jul 26, 2018

Hi Thomas,

Great work with this, was trying myself to change the Udacity DCGAN to accept new data with no luck, was happy too see someone had cracked it :-)

But have run into a few problems:

  1. First time def train reaches i=1500 program crashes with the following error:

NameError Traceback (most recent call last)
in ()
4 with tf.Graph().as_default():
5 losses, samples = train(epochs, batch_size, z_dim, learning_rate_D, learning_rate_G, beta1, dataset.get_batches,
----> 6 dataset.shape, dataset.image_mode, alpha)

in train(epoch_count, batch_size, z_dim, learning_rate_D, learning_rate_G, beta1, get_batches, data_shape, data_image_mode, alpha)
80
81
---> 82 return losses, samples

NameError: name 'losses' is not defined

  1. Set from_checkpoint = True and received following error when running tf.graph():
    INFO:tensorflow:Restoring parameters from ./models/model.ckpt

UnboundLocalError Traceback (most recent call last)
in ()
4 with tf.Graph().as_default():
5 losses, samples = train(epochs, batch_size, z_dim, learning_rate_D, learning_rate_G, beta1, dataset.get_batches,
----> 6 dataset.shape, dataset.image_mode, alpha)

in train(epoch_count, batch_size, z_dim, learning_rate_D, learning_rate_G, beta1, get_batches, data_shape, data_image_mode, alpha)
35
36
---> 37 show_generator_output(sess, 4, input_z, data_shape[3], data_image_mode, image_path, True, False)
38
39 else:

UnboundLocalError: local variable 'image_path' referenced before assignment

I am running on a local machine with GPU and Tensorflow version 1.8.0

@bubblewr-ap
Copy link

Hi I found a way to succesfully restore a model from a checkpoint by including a global_step in the graph, but I have the same problem with the losses, the error message is right, they were never defined, same as the samples.
Since I'm relatively new to ML and Tensorflow I'm actually not sure what format they should be, and when and how they should be updated

@ereish64
Copy link

ereish64 commented Mar 2, 2019

Sorry to be practicing my necromancy on dead issues, but in case your still interested in getting this code running, check out my pull request. It fixes the load model issue and the losses issue. please let me know if there is something i can help with. This repository is a little outdated so I submitted a PR to the repository maintainer with the correct fixes. Lets hope he still pays attention to this repository. ¯_(ツ)_/¯

@bubblewr-ap @hofpcp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants