-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Hello, and thanks for making this parser available!
I wrote a shell script which calls predict.py from an external directory, but I encounter the following error:
Traceback (most recent call last):
File "../udify/predict.py", line 57, in <module>
batch_size=args.batch_size)
File "/media/sf_thesis/udify/udify/util.py", line 143, in predict_model_with_archive
cuda_device=cuda_device)
File "/usr/local/lib/python3.6/dist-packages/allennlp/models/archival.py", line 230, in load_archive
cuda_device=cuda_device)
File "/usr/local/lib/python3.6/dist-packages/allennlp/models/model.py", line 327, in load
return cls.by_name(model_type)._load(config, serialization_dir, weights_file, cuda_device)
File "/usr/local/lib/python3.6/dist-packages/allennlp/models/model.py", line 265, in _load
model = Model.from_params(vocab=vocab, params=model_params)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 365, in from_params
return subclass.from_params(params=params, **extras)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 386, in from_params
kwargs = create_kwargs(cls, params, **extras)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 133, in create_kwargs
kwargs[name] = construct_arg(cls, name, annotation, param.default, params, **extras)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 229, in construct_arg
return annotation.from_params(params=subparams, **subextras)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 365, in from_params
return subclass.from_params(params=params, **extras)
File "/media/sf_thesis/udify/udify/modules/text_field_embedder.py", line 163, in from_params
for name, subparams in token_embedder_params.items()
File "/media/sf_thesis/udify/udify/modules/text_field_embedder.py", line 163, in <dictcomp>
for name, subparams in token_embedder_params.items()
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 365, in from_params
return subclass.from_params(params=params, **extras)
File "/usr/local/lib/python3.6/dist-packages/allennlp/common/from_params.py", line 388, in from_params
return cls(**kwargs) # type: ignore
File "/media/sf_thesis/udify/udify/modules/bert_pretrained.py", line 589, in __init__
model = BertModel(BertConfig.from_json_file(bert_config))
File "/usr/local/lib/python3.6/dist-packages/pytorch_pretrained_bert/modeling.py", line 206, in from_json_file
with open(json_file, "r", encoding='utf-8') as reader:
FileNotFoundError: [Errno 2] No such file or directory: 'config/archive/bert-base-multilingual-cased/bert_config.json'
The program works fine when called from within the udify directory itself, though. Would it be possible to modify the addresses in the source code to work for external calls as well? I'd be willing to help sift through the source files for this if needed.
Metadata
Metadata
Assignees
Labels
No labels