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
File not found Error: While adding extend to spacy nlp pipeline #3
Comments
Hi, can you provide us with more details? In particular, can you add your spacy_extend.py script? |
@poccio that's the spacy_extend.py script. I was just trying to check the installation part with the sample code given in the documentation. |
Hi @Vasistareddy, I'm sorry for this late reply. The problem is with your checkpoint_path string. It should point directly to the ckpt file you want to use, within its classy folder. For instance, in our spacy_test script, checkpoint_path points to experiments/extend-longformer-large/2021-10-22/09-11-39/checkpoints/best.ckpt (rather than experiments/extend-longformer-large/ as in your case) |
Thanks. That solved the issue. How much RAM does this project need? |
Using the same classy version mentioned in requirements.txt
Traceback (most recent call last):
File "spacy_extend.py", line 13, in
nlp.add_pipe("extend", after="ner", config=extend_config)
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/spacy/language.py", line 792, in add_pipe
pipe_component = self.create_pipe(
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/spacy/language.py", line 674, in create_pipe
resolved = registry.resolve(cfg, validate=validate)
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/thinc/config.py", line 746, in resolve
resolved, _ = cls._make(
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/thinc/config.py", line 795, in _make
filled, _, resolved = cls._fill(
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/thinc/config.py", line 867, in fill
getter_result = getter(*args, **kwargs)
File "/home/vasista/extend/extend/spacy_component.py", line 86, in init
self.model = load_checkpoint(checkpoint_path, device)
File "/home/vasista/extend/extend/spacy_component.py", line 22, in load_checkpoint
model = load_classy_module_from_checkpoint(checkpoint_path)
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/classy/utils/lightning.py", line 57, in load_classy_module_from_checkpoint
conf = load_training_conf_from_checkpoint(checkpoint_path)
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/classy/utils/lightning.py", line 23, in load_training_conf_from_checkpoint
conf = OmegaConf.load(f"{experiment_folder}/.hydra/{conf_file}")
File "/home/vasista/miniconda3/envs/extendtest/lib/python3.8/site-packages/omegaconf/omegaconf.py", line 183, in load
with io.open(os.path.abspath(file), "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/vasista/extend/.hydra/config.yaml'
The text was updated successfully, but these errors were encountered: