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

Model Directory while Testing #6

Closed
Pritishsingla opened this issue Feb 5, 2019 · 1 comment
Closed

Model Directory while Testing #6

Pritishsingla opened this issue Feb 5, 2019 · 1 comment

Comments

@Pritishsingla
Copy link

While testing, the model requires a copy of the model_dir to also be present in the same directory as it was at the time of training the model.
If the model_dir has been moved or renamed, an error is thrown.
The moved model directory passed in the argument --model_dir <model_dir> while testing is used to store the outputs.

``Traceback (most recent call last):
  File "main.py", line 51, in <module>
    tf.app.run()
  File "/home/ydz853/.conda/envs/env_py35/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 47, in main
    model.test()
  File "/home/ydz853/papyrus/THRED/models/vanilla/vanilla_wrapper.py", line 527, in test
    ckpt = tf.train.latest_checkpoint(self.config.get_infer_model_dir())
  File "/home/ydz853/.conda/envs/env_py35/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1722, in latest_checkpoint
    if file_io.get_matching_files(v2_path) or file_io.get_matching_files(
  File "/home/ydz853/.conda/envs/env_py35/lib/python3.5/site-packages/tensorflow/python/lib/io/file_io.py", line 333, in get_matching_files
    for single_filename in filename
  File "/home/ydz853/.conda/envs/env_py35/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /home/ydz853/model_dir_vanilla_large/best_dev_ppl; No such file or directory
@ehsk
Copy link
Collaborator

ehsk commented Feb 5, 2019

In the model directory, there is a yaml config file where the model parameters are stored. The config file also contains several file paths including the dataset files, the vocabulary files, the best model, checkpoints, and etc. I think updating these paths would resolve the issue for now. In the next version, we will make all paths relative to the model directory to avoid such issues.

@ehsk ehsk closed this as completed Feb 26, 2019
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

2 participants