0

I have tried to set up the pytorch version of the weaviate resnet50 container, but it gives me the following error:

weaviate-i2v-neural-1  | INFO:     Started server process [7]
weaviate-i2v-neural-1  | INFO:     Waiting for application startup.
weaviate-i2v-neural-1  | INFO:     CUDA_CORE set to cuda:0
weaviate-i2v-neural-1  | /usr/local/lib/python3.11/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
weaviate-i2v-neural-1  |   warnings.warn(
weaviate-i2v-neural-1  | /usr/local/lib/python3.11/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=ResNet50_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet50_Weights.DEFAULT` to get the most up-to-date weights.
weaviate-i2v-neural-1  |   warnings.warn(msg)
weaviate-i2v-neural-1  | ERROR:    Traceback (most recent call last):
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 677, in lifespan
weaviate-i2v-neural-1  |     async with self.lifespan_context(app) as maybe_state:
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 566, in __aenter__
weaviate-i2v-neural-1  |     await self._router.startup()
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 656, in startup
weaviate-i2v-neural-1  |     handler()
weaviate-i2v-neural-1  |   File "/app/app.py", line 29, in startup_event
weaviate-i2v-neural-1  |     imgVec = ImageVectorizer(cuda_support, cuda_core)
weaviate-i2v-neural-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weaviate-i2v-neural-1  |   File "/app/vectorizer.py", line 13, in __init__
weaviate-i2v-neural-1  |     self.img2vec = Img2VecPytorch(cuda_support, cuda_core)
weaviate-i2v-neural-1  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weaviate-i2v-neural-1  |   File "/app/image2vec.py", line 16, in __init__
weaviate-i2v-neural-1  |     self.model = self.model.to(self.device)
weaviate-i2v-neural-1  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1145, in to
weaviate-i2v-neural-1  |     return self._apply(convert)
weaviate-i2v-neural-1  |            ^^^^^^^^^^^^^^^^^^^^
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 797, in _apply
weaviate-i2v-neural-1  |     module._apply(fn)
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 820, in _apply
weaviate-i2v-neural-1  |     param_applied = fn(param)
weaviate-i2v-neural-1  |                     ^^^^^^^^^
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1143, in convert
weaviate-i2v-neural-1  |     return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
weaviate-i2v-neural-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weaviate-i2v-neural-1  |   File "/usr/local/lib/python3.11/site-packages/torch/cuda/__init__.py", line 247, in _lazy_init
weaviate-i2v-neural-1  |     torch._C._cuda_init()
weaviate-i2v-neural-1  | RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx
weaviate-i2v-neural-1  | 
weaviate-i2v-neural-1  | ERROR:    Application startup failed. Exiting.
weaviate-i2v-neural-1 exited with code 3

it appears the container does not contain an nvidia driver for inference. Is there a way I can fix it? I'm running a 3060 and its working fine with all other machine learning projects.

EDIT:

  i2v-neural:
    image: semitechnologies/img2vec-keras:resnet50
    environment:
      ENABLE_CUDA: '1'
      CUDA_VISIBLE_DEVICES: 'all'
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

adding these lines of code at least seems to get me closer, and the gpu shows up in nvidia-smi but I still get this error:

weaviate-i2v-neural-1 | RuntimeError: No CUDA GPUs are available

user2741831
  • 2,120
  • 2
  • 22
  • 43

0 Answers0