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

./models/scierc/model.tar.gz not found #5

Closed
zhuao5043 opened this issue Dec 1, 2019 · 7 comments
Closed

./models/scierc/model.tar.gz not found #5

zhuao5043 opened this issue Dec 1, 2019 · 7 comments

Comments

@zhuao5043
Copy link

When I run this command bash ./scripts/train/train_genia.sh 0. I got this error.Where to get model.tar.gz

@dwadden
Copy link
Owner

dwadden commented Dec 2, 2019

Thanks for creating this issue. I tried running the script myself and didn't get this error. Can you post the full console output and error message you're receiving?

@hesaamZ
Copy link

hesaamZ commented Dec 2, 2019

Hi dear David
I run "bash ./scripts/train/train_scierc.sh", have same issue.
2019-12-02 14:17:00,611 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:01,135 - INFO - pytorch_transformers.modeling_bert - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:01,138 - INFO - pytorch_transformers.modeling_xlnet - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:01,446 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:01,448 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:01,448 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:01,449 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
Traceback (most recent call last):
File "/usr/local/bin/allennlp", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.6/dist-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/init.py", line 102, in main
args.func(args)
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/train.py", line 124, in train_model_from_args
args.cache_prefix)
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/train.py", line 168, in train_model_from_file
cache_directory, cache_prefix)
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/train.py", line 207, in train_model
create_serialization_dir(params, serialization_dir, recover, force)
File "/usr/local/lib/python3.6/dist-packages/allennlp/training/util.py", line 271, in create_serialization_dir
raise ConfigurationError(f"Serialization directory ({serialization_dir}) already exists and is "
allennlp.common.checks.ConfigurationError: 'Serialization directory (./models/scierc) already exists and is not empty. Specify --recover to recover training from existing output.'
2019-12-02 14:17:03,178 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:03,703 - INFO - pytorch_transformers.modeling_bert - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:03,708 - INFO - pytorch_transformers.modeling_xlnet - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:04,032 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:04,033 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:04,034 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:04,034 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
Traceback (most recent call last):
File "/usr/local/bin/allennlp", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.6/dist-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/init.py", line 102, in main
args.func(args)
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/evaluate.py", line 129, in evaluate_from_args
archive = load_archive(args.archive_file, args.cuda_device, args.overrides, args.weights_file)
File "/usr/local/lib/python3.6/dist-packages/allennlp/models/archival.py", line 170, in load_archive
resolved_archive_file = cached_path(archive_file)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/file_utils.py", line 106, in cached_path
raise FileNotFoundError("file {} not found".format(url_or_filename))
FileNotFoundError: file ./models/scierc/model.tar.gz not found
2019-12-02 14:17:05,763 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:06,302 - INFO - pytorch_transformers.modeling_bert - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:06,306 - INFO - pytorch_transformers.modeling_xlnet - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
2019-12-02 14:17:06,631 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:06,632 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:06,633 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
2019-12-02 14:17:06,633 - INFO - allennlp.common.registrable - instantiating registered subclass relu of <class 'allennlp.nn.activations.Activation'>
Traceback (most recent call last):
File "/usr/local/bin/allennlp", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.6/dist-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/init.py", line 102, in main
args.func(args)
File "/usr/local/lib/python3.6/dist-packages/allennlp/commands/evaluate.py", line 129, in evaluate_from_args
archive = load_archive(args.archive_file, args.cuda_device, args.overrides, args.weights_file)
File "/usr/local/lib/python3.6/dist-packages/allennlp/models/archival.py", line 170, in load_archive
resolved_archive_file = cached_path(archive_file)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/file_utils.py", line 106, in cached_path
raise FileNotFoundError("file {} not found".format(url_or_filename))
FileNotFoundError: file ./models/scierc/model.tar.gz not found

@dwadden
Copy link
Owner

dwadden commented Dec 2, 2019

OK this is what I think is happening:

  • First the training script tries to train a model. Model training is failing because the target output directory already exists: allennlp.common.checks.ConfigurationError: 'Serialization directory (./models/scierc) already exists and is not empty. Specify --recover to recover training from existing output.'
  • The training script tries to evaluate the model, but since training failed you get the error FileNotFoundError: file ./models/scierc/model.tar.gz not found.

I've removed the evaluation code from the training script to make this more clear. If the directory models/scierc already exists, remove it or rename it. Then try running the training script again. Let me know if you get more errors. Once the model is trained, take a look at the README section on "Evaluating a model" to evaluate.

@zhuao5043
Copy link
Author

@dwadden
Thanks for your reply.After removing the evaluation code from training script,I run it again.Then I got another error as follows:
2019-12-03 16:29:31,018 - INFO - pytorch_pretrained_bert.modeling - Better speed
2019-12-03 16:29:31,719 - INFO - pytorch_transformers.modeling_bert - Better spe
2019-12-03 16:29:31,723 - INFO - pytorch_transformers.modeling_xlnet - Better sp
2019-12-03 16:29:32,019 - INFO - allennlp.common.registrable - instantiating reg
2019-12-03 16:29:32,020 - INFO - allennlp.common.registrable - instantiating reg
2019-12-03 16:29:32,021 - INFO - allennlp.common.registrable - instantiating reg
2019-12-03 16:29:32,022 - INFO - allennlp.common.registrable - instantiating reg
2019-12-03 16:29:32,164 - WARNING - allennlp.common.params - jsonnet not loaded
Traceback (most recent call last):
File "g:\anaconda\envs\dygiepp\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "g:\anaconda\envs\dygiepp\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "G:\Anaconda\envs\dygiepp\Scripts\allennlp.exe_main
.py", line 7, in <
File "g:\anaconda\envs\dygiepp\lib\site-packages\allennlp\run.py", line 18, in
main(prog="allennlp")
File "g:\anaconda\envs\dygiepp\lib\site-packages\allennlp\commands_init
.py
args.func(args)
File "g:\anaconda\envs\dygiepp\lib\site-packages\allennlp\commands\train.py",
args.cache_prefix)
File "g:\anaconda\envs\dygiepp\lib\site-packages\allennlp\commands\train.py",
params = Params.from_file(parameter_filename, overrides)
File "g:\anaconda\envs\dygiepp\lib\site-packages\allennlp\common\params.py", l
file_dict = json.loads(evaluate_file(params_file, ext_vars=ext_vars))
File "g:\anaconda\envs\dygiepp\lib\json_init
.py", line 348, in loads
return _default_decoder.decode(s)
File "g:\anaconda\envs\dygiepp\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "g:\anaconda\envs\dygiepp\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@dwadden
Copy link
Owner

dwadden commented Dec 3, 2019

I'm wondering if it has to do with the warning jsonnet not loaded. Can you confirm that the jsonnet library was installed correctly and works? People have had issues with this. See, for instance, allenai/allennlp#2779.

@zhuao5043
Copy link
Author

@dwadden
Hi !
I think maybe you are right. But I have tried all day to install jsonnet on my windows machine, it is still have some problem.
Anyway, thanks for your idea! : )

@dwadden
Copy link
Owner

dwadden commented Dec 4, 2019

I'm sorry, that's really frustrating. Unfortunately this is an AllenNLP issue rather than a dygiepp issue.

I suggest posting on this forum: https://discourse.allennlp.org/, or create a GitHub issue https://github.com/allenai/allennlp, if none of the open issues address your problem.

I'll close this issue for now. If you manage to get jsonnet installed but still run into issues with dyiepp, feel free to re-open.

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

3 participants