ahalterman / mordecai3

Full text geoparsing/toponym resolution with event geolocation
MIT License
63 stars 9 forks source link

CUDA Support #20

Closed Lbubeer closed 8 months ago

Lbubeer commented 9 months ago

I am having some issues when running the Mordecai geoparser and am not sure why. I suspect something related to CUDA and the pytorch version as I have it running on CPU in a different (Ubuntu) machine which is running fine. Do you know what could be causing this error? This is the output: `Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from mordecai3 import Geoparser geo = Geoparser() geo.geoparse_doc("London is a great city") Traceback (most recent call last): File "", line 1, in File "F:\Dev\Geocoding\Mordecai 3\venv\lib\site-packages\mordecai3\geoparse.py", line 325, in geoparse_doc doc = self.nlp(text) File "F:\Dev\Geocoding\Mordecai 3\venv\lib\site-packages\spacy\language.py", line 1054, in call error_handler(name, proc, [doc], e) File "F:\Dev\Geocoding\Mordecai 3\venv\lib\site-packages\spacy\util.py", line 1704, in raise_error raise e File "F:\Dev\Geocoding\Mordecai 3\venv\lib\site-packages\spacy\language.py", line 1049, in call doc = proc(doc, **component_cfg.get(name, {})) # type: ignore[call-arg] File "F:\Dev\Geocoding\Mordecai 3\venv\lib\site-packages\mordecai3\mordecai_utilities.py", line 31, in token_tensors chunklen = len(doc..trf_data.tensors[0][0]) AttributeError: 'DocTransformerOutput' object has no attribute 'tensors'`

Thanks

jonathanold commented 8 months ago

I have the same issue!

ahalterman commented 8 months ago

It turns out this is related to the version of spaCy and isn't (hopefully) a CUDA issue. I'm working on the solution at #21 so I'm closing this issue for now.