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

conda develop . # Adds DyGIE to your PYTHONPATH #2

Open
milky-FatJay opened this issue Oct 26, 2024 · 4 comments
Open

conda develop . # Adds DyGIE to your PYTHONPATH #2

milky-FatJay opened this issue Oct 26, 2024 · 4 comments

Comments

@milky-FatJay
Copy link

F6773864811B946980077839A42A5FB1
在执行conda develop . 的时候报错,请问有没有方法可以解决这个问题

@mk-runner
Copy link
Owner

F6773864811B946980077839A42A5FB1 在执行conda develop . 的时候报错,请问有没有方法可以解决这个问题

建议新建一个新环境,python 3.7,我的具体环境配置如knowledge_encoder/radgraph_requirements.yml

@milky-FatJay
Copy link
Author

F6773864811B946980077839A42A5FB1 在执行conda develop . 的时候报错,请问有没有方法可以解决这个问题

建议新建一个新环境,python 3.7,我的具体环境配置如knowledge_encoder/radgraph_requirements.yml

我已经把radgraph环境配置成功了,但是在执行配置dygiepp环境配置中的conda develop .命令仍然报错,请问这个命令的目的是什么

@mk-runner
Copy link
Owner

mk-runner commented Oct 26, 2024

F6773864811B946980077839A42A5FB1 在执行conda develop . 的时候报错,请问有没有方法可以解决这个问题

建议新建一个新环境,python 3.7,我的具体环境配置如knowledge_encoder/radgraph_requirements.yml

我已经把radgraph环境配置成功了,但是在执行配置dygiepp环境配置中的conda develop .命令仍然报错,请问这个命令的目的是什么

dygiepp环境配置,我参考的是“https://github.com/dwadden/dygiepp” 。 至于“conda develop . ”的目的,dygiepp写的是“ # Adds DyGIE to your PYTHONPATH”。

在实现RadGraph时,它是基于allennlp工具提取诊断报告中的实体与关系,allennlp又基于dygie实现的,具体实现如下所示:

os.system(f"allennlp predict {self.model_path} {self.input_path} \ --predictor dygie --include-package dygie \ --use-dataset-reader \ --output-file {self.output_path} \ --silent")

因此,dygie环境必须配置好。建议新建一个虚拟环境,严格按照dygie要求配置其环境(备注:你的python是3.11,而dygie要求3.7)

@milky-FatJay
Copy link
Author

F6773864811B946980077839A42A5FB1 在执行conda develop . 的时候报错,请问有没有方法可以解决这个问题

建议新建一个新环境,python 3.7,我的具体环境配置如knowledge_encoder/radgraph_requirements.yml

我已经把radgraph环境配置成功了,但是在执行配置dygiepp环境配置中的conda develop .命令仍然报错,请问这个命令的目的是什么

dygiepp环境配置,我参考的是“https://github.com/dwadden/dygiepp” 。 至于“conda develop . ”的目的,dygiepp写的是“ # Adds DyGIE to your PYTHONPATH”。

在实现RadGraph时,它是基于allennlp工具提取诊断报告中的实体与关系,allennlp又基于dygie实现的,具体实现如下所示:

os.system(f"allennlp predict {self.model_path} {self.input_path} \ --predictor dygie --include-package dygie \ --use-dataset-reader \ --output-file {self.output_path} \ --silent")

因此,dygie环境必须配置好。建议新建一个虚拟环境,严格按照dygie要求配置其环境(备注:你的python是3.11,而dygie要求3.7)

Traceback (most recent call last):
File "/home/yanghaofeng/anaconda3/envs/dygiepp/bin/allennlp", line 8, in
sys.exit(run())
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/main.py", line 34, in run
main(prog="allennlp")
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/commands/init.py", line 92, in main
args.func(args)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/commands/predict.py", line 211, in _predict
predictor = _get_predictor(args)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/commands/predict.py", line 110, in _get_predictor
overrides=args.overrides,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/models/archival.py", line 191, in load_archive
cuda_device=cuda_device,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/models/model.py", line 367, in load
return model_class._load(config, serialization_dir, weights_file, cuda_device)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/models/model.py", line 295, in _load
model = Model.from_params(vocab=vocab, params=model_params)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 595, in from_params
**extras,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 622, in from_params
kwargs = create_kwargs(constructor_to_inspect, cls, params, **extras)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 193, in create_kwargs
cls.name, param_name, annotation, param.default, params, **extras
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 302, in pop_and_construct_arg
return construct_arg(class_name, name, popped_params, annotation, default, **extras)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 336, in construct_arg
return annotation.from_params(params=popped_params, **subextras)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 595, in from_params
**extras,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 622, in from_params
kwargs = create_kwargs(constructor_to_inspect, cls, params, **extras)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 193, in create_kwargs
cls.name, param_name, annotation, param.default, params, **extras
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 302, in pop_and_construct_arg
return construct_arg(class_name, name, popped_params, annotation, default, **extras)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 383, in construct_arg
**extras,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 336, in construct_arg
return annotation.from_params(params=popped_params, **subextras)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 595, in from_params
**extras,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/from_params.py", line 624, in from_params
return constructor_to_call(**kwargs) # type: ignore
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/modules/token_embedders/pretrained_transformer_mismatched_embedder.py", line 53, in init
gradient_checkpointing=gradient_checkpointing,
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/modules/token_embedders/pretrained_transformer_embedder.py", line 63, in init
model_name, True, override_weights_file, override_weights_strip_prefix
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/allennlp/common/cached_transformers.py", line 79, in get
transformer = AutoModel.from_pretrained(model_name)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/transformers/modeling_auto.py", line 502, in from_pretrained
return model_class.from_pretrained(pretrained_model_name_or_path, *model_args, config=config, **kwargs)
File "/home/yanghaofeng/anaconda3/envs/dygiepp/lib/python3.7/site-packages/transformers/modeling_utils.py", line 662, in from_pretrained
raise EnvironmentError(msg)
OSError: Can't load weights for 'microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext'. Make sure that:

  • 'microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'microsoft/BiomedNLP-PubMedBERT-base-uncased-abstract-fulltext' is the correct path to a directory containing a file named one of pytorch_model.bin, tf_model.h5, model.ckpt.
    请问,这个错误怎么解决?
    在安装dygiepp中的requirements.txt中的allennlp==1.1.0和allennlp_models==1.1.0的时候发现捆绑了transformers的版本,我将transformers的版本更新了之后上述错误就消失了,但是又产生了新的错误,请问你的环境配置的版本是怎么样的?

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

2 participants