erickrf / nlpnet

A neural network architecture for NLP tasks, using cython for fast performance. Currently, it can perform POS tagging, SRL and dependency parsing.
http://nilc.icmc.usp.br/nlpnet/
MIT License
407 stars 104 forks source link

"can't multiply sequence" when SRLTagger #43

Closed biancaberdugo closed 5 years ago

biancaberdugo commented 5 years ago

I just run the test code and had that error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/nlpnet/taggers.py", line 205, in __init__
    self._load_data()
  File "/usr/local/lib/python3.5/dist-packages/nlpnet/taggers.py", line 224, in _load_data
    self.boundary_nn = load_network(md_boundary)
  File "/usr/local/lib/python3.5/dist-packages/nlpnet/taggers.py", line 38, in load_network
    nn = net_class.load_from_file(md.paths[md.network])
  File "networkconv.pyx", line 245, in nlpnet.network.ConvolutionalNetwork.load_from_file
  File "networkconv.pyx", line 223, in nlpnet.network.ConvolutionalNetwork._load_from_file
  File "network.pyx", line 258, in nlpnet.network.Network.padding_left.__set__
TypeError: can't multiply sequence by non-int of type 'float'

The test code:


import nlpnet
nlpnet.set_data_dir('/home/srl-pt')
tagger = nlpnet.SRLTagger()
tagger.tag(u'O rato roeu a roupa do rei de Roma.')
erickrf commented 5 years ago

Oops, I only checked the POS tagger in the last commit. It's fixed now for SRL too.

biancaberdugo commented 5 years ago

Works perfectly!!!! Thanks

brendasalenave commented 1 year ago

The same error is occurring when I try to use the SRLTagger.

erickrf commented 1 year ago

That is most likely due to an incompatible numpy version. Nlpnet is pretty old now and I haven't updated it to newer packages, so I'd first suggest downgrading numpy.