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

jsonnet_evaluate_file issue on branch allennlp-1.0 #66

Open
vdenberg opened this issue Mar 30, 2021 · 3 comments
Open

jsonnet_evaluate_file issue on branch allennlp-1.0 #66

vdenberg opened this issue Mar 30, 2021 · 3 comments

Comments

@vdenberg
Copy link

vdenberg commented Mar 30, 2021

Hi,

When following the instructions in https://github.com/allenai/dont-stop-pretraining/blob/master/DATA_SELECTION.md, upon running the command ""python -m scripts.train --config training_config/vampire.jsonnet --serialization-dir model_logs/vampire-world --environment VAMPIRE --device 0 -o", I get the following error:

overriding model_logs/vampire-world
2021-03-30 17:05:56,684 - INFO - transformers.file_utils - PyTorch version 1.5.1 available.
Something went wrong during jsonnet_evaluate_file, please report this: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: 'Z'
Aborted
Traceback (most recent call last):
File "/path/to/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/path/to/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/path/to//dont-stop-pretraining/vampire/scripts/train.py", line 89, in
main()
File "/path/to/dont-stop-pretraining/vampire/scripts/train.py", line 85, in main
subprocess.run(" ".join(allennlp_command), shell=True, check=True)
File "/path/to/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-world' returned non-zero exit status 134.

I notice this is the same error as issue #65.

I also notice training works if I use the master branch, so this seems to be an issue related to the branch the DSP DATA_SELECTION.md requires.

Could you perhaps help out with this? Thank you!

@chuyuanli
Copy link

chuyuanli commented Apr 5, 2021

Hi, I have the same problem.
I used Allennlp cli to tune with the command allennlp tune config/aa.jsonnet config/hparams.json --serialization-dir result/hpo --study-name test --skip-if-exists.

And I got the error:

/allennlp_optuna/commands/tune.py:55: ExperimentalWarning: AllenNLPExecutor is experimental (supported from v1.4.0). The interface can change in the future.
include_package=include_package,
Something went wrong during jsonnet_evaluate_file, please report this: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: 'a'
Aborted

I don't understand this jsonnet_evaluate_file. Any idea?
Thanks!

@himkt
Copy link

himkt commented Apr 8, 2021

Hello @vdenberg, I came here because @chuyuanli mentioned this issue in himkt/allennlp-optuna#33. In the issue of allennlp-optuna, the error occurred when passing a string literal to std.parseJson.

std.parseJson(std.extVar("some_var"))
# std.extVar("some_var") => "hoge"
std.pareJson("hoge") # => json.exception.parse_error!

@dendrenn
Copy link

dendrenn commented May 12, 2021

Just to clarify for anyone who may come across this in the future -- replace the following two lines in vampire.jsonnet and the command should work as expected:

# "z_dropout": std.parseJson("Z_DROPOUT"),
"z_dropout": std.extVar("Z_DROPOUT"),

# "lr": std.parseJson("LEARNING_RATE"),
"lr": std.parseJson(std.extVar("LEARNING_RATE")),

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

4 participants