buriburisuri / SRGAN

A tensorflow implemenation of Christian et al's SRGAN(super-resolution generative adversarial network)
MIT License
285 stars 80 forks source link

I can't be able to restore the saved net #6

Open openviso opened 7 years ago

openviso commented 7 years ago

runfile('D:/SRGAN-master/generate.py', wdir='D:/SRGAN-master') Extracting ./asset/data/mnist\train-images-idx3-ubyte.gz Extracting ./asset/data/mnist\train-labels-idx1-ubyte.gz Extracting ./asset/data/mnist\t10k-images-idx3-ubyte.gz Extracting ./asset/data/mnist\t10k-labels-idx1-ubyte.gz Traceback (most recent call last):

File "", line 1, in runfile('D:/SRGAN-master/generate.py', wdir='D:/SRGAN-master')

File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace)

File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/SRGAN-master/generate.py", line 60, in saver.restore(sess, tf.train.latest_checkpoint('asset/train/ckpt'))

File "C:\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1388, in restore {self.saver_def.filename_tensor_name: save_path})

File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 766, in run run_metadata_ptr)

File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 964, in _run feed_dict_string, options, run_metadata)

File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1014, in _do_run target_list, options, run_metadata)

File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1021, in _do_call return fn(*args)

File "C:\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1003, in _run_fn status, run_metadata)

SystemError: returned a result with an error set

xolott commented 7 years ago

I have the same problem.


TypeError: expected bytes, NoneType found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "generate.py", line 60, in <module>
    saver.restore(sess, tf.train.latest_checkpoint('asset/train/ckpt'))
  File "/media/Documents/Symmetrik/PythonEnviroments/tesnorflow1.0Python3.5/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1428, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/media/Documents/Symmetrik/PythonEnviroments/tesnorflow1.0Python3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 767, in run
    run_metadata_ptr)
  File "/media/Documents/Symmetrik/PythonEnviroments/tesnorflow1.0Python3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 965, in _run
    feed_dict_string, options, run_metadata)
  File "/media/Documents/Symmetrik/PythonEnviroments/tesnorflow1.0Python3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1015, in _do_run
    target_list, options, run_metadata)
  File "/media/Documents/Symmetrik/PythonEnviroments/tesnorflow1.0Python3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1022, in _do_call
    return fn(*args)
  File "/media/Documents/Symmetrik/PythonEnviroments/tesnorflow1.0Python3.5/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1004, in _run_fn
    status, run_metadata)
SystemError: <built-in function TF_Run> returned a result with an error set
xolott commented 7 years ago

The problem was on saver.restore(sess, tf.train.latest_checkpoint('asset/train/ckpt'))

The subdirectory ckpt doesn't exists. So, leaving that line with: saver.restore(sess, tf.train.latest_checkpoint('asset/train/'))

works!

kevinjoseph1995 commented 6 years ago

Thank you so much for this!