dongheehand / DeblurGAN-tf

Tensorflow implementation of DeblurGAN(Blind Motion Deblurring Using Conditional Adversarial Networks)
80 stars 24 forks source link

Pre-trained model files out of data #2

Closed jpds closed 4 years ago

jpds commented 5 years ago

I try and deblur my own image with the pre-trained model files and hit:

Instructions for updating:
Use standard file APIs to check for files with this prefix.
Traceback (most recent call last):
  File "main.py", line 77, in <module>
    test_only(args, model, sess, saver)
  File "/home/user/test2/DeblurGAN-tf/mode.py", line 157, in test_only
    saver.restore(sess,args.pre_trained_model)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1292, in restore
    err, "a Variable name or other graph key that is missing")
tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Tensor name "discriminator/conv00/bias" not found in checkpoint files /home/user/model/DeblurrGAN_last.index
         [[node save/RestoreV2 (defined at main.py:66) ]]

Caused by op u'save/RestoreV2', defined at:
  File "main.py", line 66, in <module>
    saver = tf.train.Saver(max_to_keep = None)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 832, in __init__
    self.build()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 844, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 881, in _build
    build_save=build_save, build_restore=build_restore)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 513, in _build_internal
    restore_sequentially, reshape)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 332, in _AddRestoreOps
    restore_sequentially)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 580, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 1572, in restore_v2
    name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1801, in __init__
    self._traceback = tf_stack.extract_stack()

NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Tensor name "discriminator/conv00/bias" not found in checkpoint files /home/user/model/DeblurrGAN_last.index
         [[node save/RestoreV2 (defined at main.py:66) ]]
dongheehand commented 5 years ago

I think your --pre_trained_model option is ./DeblurGAN_model/DeblurrGAN_last.index Option should be ./DeblurGAN_model/DeblurrGAN_last If you exclude .index it could work.

changbaishan commented 5 years ago

./DeblurGAN_model/DeblurrGAN_last is an important point. I hope you update the instructions so other people don't suffer the problem I had. Thanks for your attention.