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

I am getting this error #11

Closed
eswar-gaiansolutions opened this issue May 29, 2023 · 17 comments
Closed

I am getting this error #11

eswar-gaiansolutions opened this issue May 29, 2023 · 17 comments

Comments

@eswar-gaiansolutions
Copy link

Traceback (most recent call last):
File "main.py", line 99, in
en_nlp = stanza.Pipeline('en',processors={'tokenize':'spacy'})
File "/home/gaian/.local/lib/python3.8/site-packages/stanza/pipeline/core.py", line 139, in init
self.processors[processor_name] = NAME_TO_PROCESSOR_CLASS[processor_name](config=curr_processor_config,
File "/home/gaian/.local/lib/python3.8/site-packages/stanza/pipeline/processor.py", line 159, in init
self._set_up_model(config, use_gpu)
File "/home/gaian/.local/lib/python3.8/site-packages/stanza/pipeline/pos_processor.py", line 25, in _set_up_model
self._trainer = Trainer(pretrain=self.pretrain, model_file=config['model_path'], use_cuda=use_gpu)
File "/home/gaian/.local/lib/python3.8/site-packages/stanza/models/pos/trainer.py", line 35, in init
self.load(model_file, pretrain)
File "/home/gaian/.local/lib/python3.8/site-packages/stanza/models/pos/trainer.py", line 120, in load
self.model.load_state_dict(checkpoint['model'], strict=False)
File "/home/gaian/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1406, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Tagger:
size mismatch for drop_replacement: copying a param with shape torch.Size([2248]) from checkpoint, the shape in current model is torch.Size([325]).
size mismatch for taggerlstm.lstm.0.lstm.weight_ih_l0: copying a param with shape torch.Size([800, 2248]) from checkpoint, the shape in current model is torch.Size([800, 325]).
size mismatch for taggerlstm.lstm.0.lstm.weight_ih_l0_reverse: copying a param with shape torch.Size([800, 2248]) from checkpoint, the shape in current model is torch.Size([800, 325]).
size mismatch for taggerlstm.highway.0.weight: copying a param with shape torch.Size([400, 2248]) from checkpoint, the shape in current model is torch.Size([400, 325]).
size mismatch for taggerlstm.gate.0.weight: copying a param with shape torch.Size([400, 2248]) from checkpoint, the shape in current model is torch.Size([400, 325]).

@shoebham
Copy link
Owner

Did you install spacy?
try installing all the required modules with

pip install -r requirements.txt

additionally install spacy as that is not in requirements.txt
by :

pip install spacy

@eswar-gaiansolutions
Copy link
Author

After Installing spacy also it did not worked

@shoebham
Copy link
Owner

is it giving same error after installing spacy.
please elaborate more on your comments always provide as much information as you can.

@vinay0981123
Copy link

same here getting same error.

@vinay0981123
Copy link

vinay0981123 commented Jul 4, 2023

Ok let me tell you more my python version is 3.9.8 and pip is 21.2.4 and I followed the instruction and successfully installed everything including spacy following mentioned version now getting the error and i didnt activated venv installed everything globally now please let me know if this is happening due to some conflict or some version issue?
image
image

@shoebham
Copy link
Owner

shoebham commented Jul 4, 2023

spacy might have changed their model.
can you please run

pip show spacy
pip show stanza

It is most likely a version issue.
The project runs fine on my system. my versions are
python: 3.9.0
spacy: 3.5.2
stanza: 1.4.0

and urllib one is just a warning that you can ignore.
I will fix the version compatibility issue in the future. for now please install these versions.

@vinay0981123
Copy link

getting output:
image

@vinay0981123
Copy link

See initially I was using latest version of python and pip and while installing i was having issue with installation something like build issue so i seen this was happening because of latest pip so i manually installed every modules and started your program then i was passing text but it was not able to recieve the text and it was sending the error stanford-parser-full-2018-10-17.zip not found or not accessible i checked this link there were a message service is close till 3 july now you can check the link again for the file its showing 404 not found then i changed the version of python with 3.9.8 and again installed every dependecies without having any issue with the same version what you mentioned but now giving this error.

@shoebham
Copy link
Owner

shoebham commented Jul 4, 2023

I just saw that the page is returning 404.
I have uploaded the zip file on my drive, just paste it in the same folder as main.py
https://drive.google.com/file/d/1lEafb759ZbA33VNvwZOr0fznhtC4Kf4P/view

rest i think you got the project working if you were able to enter the text, with this zip you'll be fine

@vinay0981123
Copy link

vinay0981123 commented Jul 5, 2023

getting this error now when i submit text to convert.
image
image
image
image
image

@shoebham
Copy link
Owner

shoebham commented Jul 5, 2023

try setting this inside path
%JAVA_HOME%\bin
image

and did you restart vscode after setting java home cause we need to restart the terminal after setting variables

@shoebham
Copy link
Owner

shoebham commented Jul 5, 2023

and try not putting multiple paths like you have put oracle one twice, remove them both and just set %JAVA_HOME%\bin

@vinay0981123
Copy link

vinay0981123 commented Jul 5, 2023

Thank you so much bro its working fine now but see this if we can ignore that part in red one
image

@vinay0981123
Copy link

Now facing this issue. this worked fine 2 to 3 times but now having issue
image

@shoebham
Copy link
Owner

shoebham commented Jul 5, 2023

Now facing this issue. this worked fine 2 to 3 times but now having issue
image

just retry it will work it sometimes happen

@atharvauk15
Copy link

I just saw that the page is returning 404. I have uploaded the zip file on my drive, just paste it in the same folder as main.py https://drive.google.com/file/d/1lEafb759ZbA33VNvwZOr0fznhtC4Kf4P/view

rest i think you got the project working if you were able to enter the text, with this zip you'll be fine

I dont have to extract the file right?
Just directly paste it inside the folder containing main.py?

@shoebham
Copy link
Owner

You can extract it or the let the code extract up to you

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