nrl-qasrl
nrl-qasrl copied to clipboard
TypeError: from_params() takes 2 positional arguments but 4 were given
After reading "QA-SRL", I ran the code after installing Allennlp 0.8.3. It reported an error:"TypeError: from_params() takes 2 positional arguments but 4 were given"
File "/home/lixin/Documents/qasrl-bank-master/nrl-qasrl-master/nrl/models/qasrl_parser.py", line 34, in from_params span_detector = Model.from_params(vocab, params.pop("span_detector")) TypeError: from_params() takes 2 positional arguments but 3 were given.
I can't find the function from_params() in the class 'model'. So,is it the reason for the framework version? How can i solve it .
I am a beginner, thank you for your help.
I meet a similar problem, but I have "3 were given"...π I do not know how to solve it ........
I meet a similar problem, but I have "3 were given"...π I do not know how to solve it ........
If you run it on version 0.5.1 ,the demo can be operated. But training has some problems. If you get the result ,please tell me. Thanks.
I meet a similar problem, but I have "3 were given"...π I do not know how to solve it ........
If you run it on version 0.5.1 ,the demo can be operated. But training has some problems. If you get the result ,please tell me. Thanks.
Do you mean pytorch 0.4.1?
I have python3.6.5 with pytorch 0.4.1, but still have the problem when running "python3 -m allennlp.run predict ./data/qasrl_parser_elmo demo.txt --include-package nrl --predictor qasrl_parser --output-file demo.txt.out"
The demo.txt is "
{"sentence": "John went to the store."}
{"sentence": "The man ate the burrito and threw the trash in the garbage"}
"
I also met 2 import errors in "nrl/service/server_simple_gpu.py", I changed "from gevent.wsgi import WSGIServer" to "from gevent.pywsgi import WSGIServer" and comment out "from allennlp.service.server_flask import ServerError", I do not know whether it is OK...
Do you have any idea with these? Thanks.
I meet a similar problem, but I have "3 were given"...π I do not know how to solve it ........
If you run it on version 0.5.1 ,the demo can be operated. But training has some problems. If you get the result ,please tell me. Thanks.
Do you mean pytorch 0.4.1? I have python3.6.5 with pytorch 0.4.1, but still have the problem when running "python3 -m allennlp.run predict ./data/qasrl_parser_elmo demo.txt --include-package nrl --predictor qasrl_parser --output-file demo.txt.out" The demo.txt is " {"sentence": "John went to the store."} {"sentence": "The man ate the burrito and threw the trash in the garbage"} "
I also met 2 import errors in "nrl/service/server_simple_gpu.py", I changed "from gevent.wsgi import WSGIServer" to "from gevent.pywsgi import WSGIServer" and comment out "from allennlp.service.server_flask import ServerError", I do not know whether it is OK...
Do you have any idea with these? Thanks.
allennlp version=0.5.1 δ½ ε―δ»₯θ―δΈδΈ
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
This code was built for allennlp 0.5.0 and pytorch
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
OK, I will try later.Thanks for your reply.
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
when I train the model, I face an error like this:
File "/home/leex/Documents/qasrl-bank-master/nrl-qasrl-master/nrl/metrics/threshold_metric.py", line 119, in get_matches matching = [(g, p) for g, p in matching.items() if g in gold_spans] AttributeError: 'set' object has no attribute 'items'
Platform: ubuntu 14/allennlp==0.5.1/torch==0.4.0
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
That's works for predication, thank you~
I changed
self._pretrained_vectors = read_pretrained_file("https://s3-us-west-2.amazonaws.com/allennlp/datasets/glove/glove.6B.100d.txt.gz")
to
self._pretrained_vectors = read_pretrained_file("data/glove/glove.6B.100d.txt.gz")
in nrl/service/predictors/qasrl_parser.py
for utilizing local word embedding file.
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
That's works for predication, thank you~
I changed self._pretrained_vectors = read_pretrained_file("https://s3-us-west-2.amazonaws.com/allennlp/datasets/glove/glove.6B.100d.txt.gz") to self._pretrained_vectors = read_pretrained_file("data/glove/glove.6B.100d.txt.gz") in nrl/service/predictors/qasrl_parser.py for utilizing local word embedding file.
Have you run the training model smoothly?
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
That's works for predication, thank you~ I changed self._pretrained_vectors = read_pretrained_file("https://s3-us-west-2.amazonaws.com/allennlp/datasets/glove/glove.6B.100d.txt.gz") to self._pretrained_vectors = read_pretrained_file("data/glove/glove.6B.100d.txt.gz") in nrl/service/predictors/qasrl_parser.py for utilizing local word embedding file.
Have you run the training model smoothly?
I did not run the training model, because I only need to parse several documents with the pretrained model ....
I meet a similar problem, but I have "3 were given"...π I do not know how to solve it ........
If you run it on version 0.5.1 ,the demo can be operated. But training has some problems. If you get the result ,please tell me. Thanks.
Do you mean pytorch 0.4.1? I have python3.6.5 with pytorch 0.4.1, but still have the problem when running "python3 -m allennlp.run predict ./data/qasrl_parser_elmo demo.txt --include-package nrl --predictor qasrl_parser --output-file demo.txt.out" The demo.txt is " {"sentence": "John went to the store."} {"sentence": "The man ate the burrito and threw the trash in the garbage"} "
I also met 2 import errors in "nrl/service/server_simple_gpu.py", I changed "from gevent.wsgi import WSGIServer" to "from gevent.pywsgi import WSGIServer" and comment out "from allennlp.service.server_flask import ServerError", I do not know whether it is OK...
Do you have any idea with these? Thanks.
for the import error "allennlp.service.server_flask import ServerError", change it to "allennlp.service.server_simple import ServerError"
This code was built for allennlp 0.5.0 and pytorch 0.4.0.
pytorch 0.4.0 is not available now.