run-youngjoo/SC-FEGAN

ValueError: Couldn't find 'checkpoint' file or checkpoints in given directory /home/mustafa/ckpt

tomriddle54 opened this issue · 14 comments

I have changed the yml file to CKPT_DIR: '/home/mustafa/ckpt' inside this dir there is model file SC-FEGAN.ckpt.data-00000-of-00001 and index file SC-FEGAN.ckpt.index
error is

Model loaded from /home/mustafa/ckpt....start
Traceback (most recent call last):
  File "demo.py", line 234, in <module>
    ex = Ex(model, config)
  File "demo.py", line 22, in __init__
    self.model.load_demo_graph(config)
  File "/media/mustafa/ubuntu_backup/Projects/gan/SC-FEGAN/model.py", line 111, in load_demo_graph
    var_value = tf.contrib.framework.load_variable(ckpt_path, from_name)
  File "/home/mustafa/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/framework/python/framework/checkpoint_utils.py", line 79, in load_variable
    reader = load_checkpoint(checkpoint_dir)
  File "/home/mustafa/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/framework/python/framework/checkpoint_utils.py", line 62, in load_checkpoint
    "given directory %s" % filepattern)
ValueError: Couldn't find 'checkpoint' file or checkpoints in given directory /home/mustafa/ckpt

Make the './ckpt' dir in SC-FEGAN project folder plz.

Have you solved this problem

Yes I have solved this issue

Please tell me how you solved it.

I create ckpt dir and pasted the model files there

I am the CKPT directory created under the SC-FEGAN project, but I still report an error.

Can I see your demo.yaml?

you need to give SC-FEGAN.ckpt name on yaml here is my yaml

INPUT_SIZE: 512
BATCH_SIZE: 1

GPU_NUM: 1

# directories
CKPT_DIR: 'ckpt/SC-FEGAN.ckpt'

Thank you for your help. I think I've found the reason.

What was the reason write it down so this can help others

I have just solved this question. this is my filename: model.ckpt-100000.data-00000-of-00001 and shell command: python run pretraining --init_checkpoint=./ckpt/model.ckpt-100000
so, when you enter the file name, you just ignore the .data-00000-of-00001

I fixed the error, your files should be called "model.ckpt.....", in my case it was something like "bert-model.ckpt" which does not work. It does not matter if there are other files, such as config.json, in your directory as long as the checkpoints are named "model.ckpt....."