allenai / vampire

Variational Methods for Pretraining in Resource-limited Environments
Apache License 2.0
174 stars 33 forks source link

AssertionError in training scripts #37

Closed meghanabhange closed 5 years ago

meghanabhange commented 5 years ago

I have been trying to run the tutorial on README and wasn't able to run the training script.

I tried to run it on a different VM but still seem to get the same AssertionError: Please set STANFORDNLP_TEST_HOME environment variable for test working dir, base name must be: stanfordnlp_test error

The error stacktrace:

2019-07-17 06:19:27,060 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
Traceback (most recent call last):
  File "/opt/anaconda3/bin/allennlp", line 10, in <module>
    sys.exit(run())
  File "/opt/anaconda3/lib/python3.7/site-packages/allennlp/run.py", line 18, in run
    main(prog="allennlp")
  File "/opt/anaconda3/lib/python3.7/site-packages/allennlp/commands/__init__.py", line 101, in main
    import_submodules(package_name)
  File "/opt/anaconda3/lib/python3.7/site-packages/allennlp/common/util.py", line 328, in import_submodules
    for module_finder, name, _ in pkgutil.walk_packages(path):
  File "/opt/anaconda3/lib/python3.7/pkgutil.py", line 92, in walk_packages
    __import__(info.name)
  File "/opt/anaconda3/lib/python3.7/site-packages/tests/__init__.py", line 17, in <module>
    f'Please set {TEST_HOME_VAR} environment variable for test working dir, base name must be: {TEST_DIR_BASE_NAME}'
AssertionError: Please set STANFORDNLP_TEST_HOME environment variable for test working dir, base name must be: stanfordnlp_test
Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jupyter/vampire/scripts/train.py", line 75, in <module>
    main()
  File "/home/jupyter/vampire/scripts/train.py", line 71, in main
    subprocess.run(" ".join(allennlp_command), shell=True, check=True)
  File "/opt/anaconda3/lib/python3.7/subprocess.py", line 468, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'allennlp train --include-package vampire training_config/vampire.jsonnet -s model_logs/vampire' returned non-zero exit status 1.
kernelmachine commented 5 years ago

Do you have stanfordNLP also installed on your system(s)? It seems like the error is coming from there: https://github.com/stanfordnlp/stanfordnlp/blob/d8061501ff14c73734e834a08fa33c58c4a6d917/tests/__init__.py

The immediate thing I would recommend is to run the tutorial on a fresh python3 environment.

meghanabhange commented 5 years ago

Yes, I had stanfordNLP installed export STANFORDNLP_TEST_HOME=stanfordnlp_test helped.

kernelmachine commented 5 years ago

Closing as this has been solved. Feel free to reopen if you have any extra related questions.