atriumlts / subpixel

subpixel: A subpixel convnet for super resolution with Tensorflow
MIT License
2.13k stars 301 forks source link

Training example does not run #6

Closed dribnet closed 7 years ago

dribnet commented 7 years ago

The README.md says to run python main.py --dataset celebA --is_train True --is_crop True. But when I do this it crashes with the error:

Traceback (most recent call last):
  File "main.py", line 58, in <module>
    tf.app.run()
  File "/usr/local/anaconda2/envs/subpixel/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
    sys.exit(main(sys.argv[:1] + flags_passthrough))
  File "main.py", line 39, in main
    dataset_name=FLAGS.dataset, is_crop=FLAGS.is_crop, checkpoint_dir=FLAGS.checkpoint_dir)
  File "/develop/nets/subpixel/model.py", line 58, in __init__
    self.build_model()
  File "/develop/nets/subpixel/model.py", line 64, in build_model
    self.up_inputs = tf.image.resize_images(self.inputs, self.image_shape[0], self.image_shape[1], tf.image.ResizeMethod.NEAREST_NEIGHBOR)
  File "/usr/local/anaconda2/envs/subpixel/lib/python2.7/site-packages/tensorflow/python/ops/image_ops.py", line 787, in resize_images
    raise ValueError('\'size\' must be a 1-D Tensor of 2 elements: '
ValueError: 'size' must be a 1-D Tensor of 2 elements: new_height, new_width

Running the same example from the carpedm20/DCGAN-tensorflow repo works fine for me.

EderSantana commented 7 years ago

Hi Tom! it runs for me... which version of tensorflow are you using? perhaps I should say that I used 0.10.0rc0 installed from source. my bad...

Could you please check the api of tf.image.resize_images in your version? It seems that for me it gets two separate inputs, height, width and yours get a single list [height, width]

EderSantana commented 7 years ago

here check out the change https://gist.github.com/EderSantana/9b0d5fb309d775b995d5236c32238349

lets make sure it works for you. I'm pretty sure you will do amazing stuff with it. Btw, if you would prefer a theano version, there is one I could get you.

dribnet commented 7 years ago

Awesome, thanks @EderSantana - that one line fix in build_model fixed it. I committed this in pull request #7 if you want to pull this into the master branch.