localminimum / QANet

A Tensorflow implementation of QANet for machine reading comprehension
MIT License
983 stars 310 forks source link

word_embed.json missing? #10

Closed theSage21 closed 6 years ago

theSage21 commented 6 years ago

I'm trying to train/demo the code and in both cases, python config.py --mode train and python config.py --mode demo I end up hitting the same error.

The last few bits of the traceback are:

  File "config.py", line 125, in main
    train(config)
  File "/home/arjoonn/Fast-Reading-Comprehension/main.py", line 19, in train
    with open(config.word_emb_file, "r") as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'data/word_emb.json'

I saw some commented out things in the download.sh file, should I be un-commenting those?

ghost commented 6 years ago

Hi @theSage21 you should run python config --mode prepro first to generate word and char embeddings.

theSage21 commented 6 years ago

I apologize. I'll close this issue once I have reached a laptop and verified that this is indeed what I was doing wrong.

theSage21 commented 6 years ago

That fixes the error I mentioned. There's a new traceback when I run python config.py --mode demo.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/arjoonn/Fast-Reading-Comprehension/demo.py", line 74, in demo_backend
    saver.restore(sess, tf.train.latest_checkpoint(config.save_dir))
  File "/home/arjoonn/.local/share/virtualenvs/Fast-Reading-Comprehension-0EDTNTsW/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1769, in restore
    raise ValueError("Can't load save_path when it is None.")
ValueError: Can't load save_path when it is None.

Should setting save_path='train' in the config.py file fix this? I also don't find demo.html anywhere in the tree, though the demo.py needs this to run.

theSage21 commented 6 years ago

Just saw #11 . If the demo.html is the same as the Rnet file I can submit a PR.

ghost commented 6 years ago

Could you submit a pr of demo.html? It's identical to rnet's. I'm not with my computer and I won't be for a while but I can approve the pr which fixes the problem from #11. Thanks!

ghost commented 6 years ago

Sorry just saw the "ValueError" problem. You should put the "FRC" directory inside "train" directory and keep these lines in config.py.

train_dir = "train"
model_name = "FRC"
theSage21 commented 6 years ago

Your closing of the issue made me assume that that was indeed the fix. :+1: