You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our dockerfile looks something like this, from nvidia CUDA 12.6.2 ubuntu 22.04 image
FROM nvidia/cuda:12.6.2-cudnn-runtime-ubuntu22.04
# Upgrade ubuntu packages# Install dependencies with pip base on pyproject.toml (see complete dump at the end)CMD ["poetry", "run", "gunicorn", "nlp.api.predict:app", "-c" ,"config/gunicorn.config.py"]
With the python file predict.py (2 files simplified into a single one)
importspacyfromfastapiimportFastAPIclassPipeline:
def__init__(self) ->None:
self.model_path=Noneself.nlp=Noneself.get_and_load_model()
defget_and_load_model(self):
self.get_model_from_bucket()
defload_model(self):
spacy.require_gpu(0)
self.nlp=spacy.load(self.model_path)
defget_model_from_bucket(self) ->spacy.Language:
self.model_path=self.download_folder_files()
self.load_model()
defdownload_folder_files(self) ->str:
self.model_path="/tmp/model"# Download ML model from bucket to local folder /tmp/model/app=FastAPI()
pipeline=Pipeline()
I get the following error while spawning the server:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/gunicorn/arbiter.py", line 609, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.10/dist-packages/uvicorn/workers.py", line 66, in init_process
super(UvicornWorker, self).init_process()
File "/usr/local/lib/python3.10/dist-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.10/dist-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python3.10/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python3.10/dist-packages/gunicorn/app/wsgiapp.py", line 58, in load
returnself.load_wsgiapp()
File "/usr/local/lib/python3.10/dist-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python3.10/dist-packages/gunicorn/util.py", line 371, in import_app
mod = importlib.import_module(module)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/opt/app/nlp/api/predict.py", line 17, in<module>
pipeline = Pipeline()
File "/opt/app/nlp/api/pipeline.py", line 40, in __init__
self.get_and_load_model()
File "/opt/app/nlp/api/pipeline.py", line 55, in get_and_load_model
self.get_model_from_bucket()
File "/opt/app/nlp/api/pipeline.py", line 77, in get_model_from_bucket
self.load_model()
File "/opt/app/nlp/api/pipeline.py", line 63, in load_model
self.nlp = spacy.load(self.model_path)
File "/usr/local/lib/python3.10/dist-packages/spacy/__init__.py", line 51, in load
return util.load_model(
File "/usr/local/lib/python3.10/dist-packages/spacy/util.py", line 467, in load_model
return load_model_from_path(Path(name), **kwargs) # type: ignore[arg-type]
File "/usr/local/lib/python3.10/dist-packages/spacy/util.py", line 539, in load_model_from_path
nlp = load_model_from_config(
File "/usr/local/lib/python3.10/dist-packages/spacy/util.py", line 587, in load_model_from_config
nlp = lang_cls.from_config(
File "/usr/local/lib/python3.10/dist-packages/spacy/language.py", line 1855, in from_config
nlp = lang_cls(
File "/usr/local/lib/python3.10/dist-packages/spacy/language.py", line 188, in __init__
util.registry._entry_point_factories.get_all()
File "/usr/local/lib/python3.10/dist-packages/catalogue/__init__.py", line 110, in get_all
result.update(self.get_entry_points())
File "/usr/local/lib/python3.10/dist-packages/catalogue/__init__.py", line 125, in get_entry_points
result[entry_point.name] = entry_point.load()
File "/usr/local/lib/python3.10/dist-packages/importlib_metadata/__init__.py", line 189, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/opt/app/nlp/architecture/ner.py", line 7, in<module>
from .entity_recognizer import EntityRecognizer
File "nlp/architecture/entity_recognizer.pyx", line 1, in init nlp.architecture.entity_recognizer
# cython: infer_types=True, profile=True, binding=True
ValueError: spacy.strings.StringStore size changed, may indicate binary incompatibility. Expected 96 from C header, got 64 from PyObject
How to reproduce the behaviour
It happened suddenly after an image rebuild.
Our dockerfile looks something like this, from nvidia CUDA 12.6.2 ubuntu 22.04 image
With the python file
predict.py
(2 files simplified into a single one)I get the following error while spawning the server:
We tried:
cupy-cuda12x
because of Numpy, see Numpy 2.0 update causing issues with other software #13669Your Environment
The text was updated successfully, but these errors were encountered: