philipperemy / stanford-openie-python

Stanford Open Information Extraction made simple!
ISC License
635 stars 102 forks source link

AttributeError #37

Closed CJPJ007 closed 3 years ago

CJPJ007 commented 3 years ago

Traceback (most recent call last): File "projects/ie.py", line 3, in with StanfordOpenIE() as client: File "/home/jaypal/.local/lib/python3.8/site-packages/openie/openie.py", line 37, in init from stanfordnlp.server import CoreNLPClient File "/home/jaypal/.local/lib/python3.8/site-packages/stanfordnlp/init.py", line 1, in from stanfordnlp.pipeline.core import Pipeline File "/home/jaypal/.local/lib/python3.8/site-packages/stanfordnlp/pipeline/core.py", line 7, in import torch File "/home/jaypal/.local/lib/python3.8/site-packages/torch/init.py", line 196, in from torch._C import * ImportError: /home/jaypal/.local/lib/python3.8/site-packages/torch/lib/libtorch_cuda.so: cannot read file data Exception ignored in: <function StanfordOpenIE.del at 0x7f2d0548d940> Traceback (most recent call last): File "/home/jaypal/.local/lib/python3.8/site-packages/openie/openie.py", line 100, in del self.client.stop() AttributeError: 'StanfordOpenIE' object has no attribute 'client'

I am getting this error. I have successfully installed stanford_openie library. What to do to solve this error?

philipperemy commented 3 years ago

@CJPJ007 it seems like it's a pytorch error, independent of this library:

Try to solve it like this: https://github.com/pytorch/pytorch/issues/44191

philipperemy commented 3 years ago

I fixed the attribute error problem: https://github.com/philipperemy/Stanford-OpenIE-Python/pull/38. The source of the problem is the installation of Pytorch. Please post your issue on https://github.com/stanfordnlp/CoreNLP as this issue is unrelated to the python wrapper of OpenIE. Thank you!