gpt4 book ai didi

python - 在Azure Kubernetes服务中部署时导入cv2错误-python

转载 作者:行者123 更新时间:2023-12-02 16:57:58 26 4
gpt4 key购买 nike

我已经阅读过有关天蓝色应用程序服务的类似问题,但仍然找不到答案。我试图在azure kubernetes服务中部署模型,但是在导入cv2时遇到错误(这对我很重要)。
Opencv-python包含在我的环境.yaml文件中:

name: project_environment
dependencies:
# The python interpreter version.
# Currently Azure ML only supports 3.5.2 and later.
- python=3.6.2

- pip:
# You must list azureml-defaults as a pip dependency
- azureml-defaults>=1.0.45
- Cython
- matplotlib>=3.2.2
- numpy>=1.18.5
- opencv-python>=4.1.2
- pillow
- PyYAML>=5.3
- scipy>=1.4.1
- torch>=1.6.0
- torchvision>=0.7.0
- tqdm>=4.41.0
channels:
- conda-forge
我正在按以下方式部署:
aks_service = Model.deploy(ws,
models=[model],
inference_config=inference_config,
deployment_config=gpu_aks_config,
deployment_target=aks_target,
name=aks_service_name)
我得到这个错误:
    Traceback (most recent call last):
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
worker.init_process()
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
self.load_wsgi()
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
self.wsgi = self.app.wsgi()
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
return self.load_wsgiapp()
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
return util.import_app(self.app_uri)
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
__import__(module)
File "/var/azureml-server/wsgi.py", line 1, in <module>
import create_app
File "/var/azureml-server/create_app.py", line 3, in <module>
from app import main
File "/var/azureml-server/app.py", line 32, in <module>
from aml_blueprint import AMLBlueprint
File "/var/azureml-server/aml_blueprint.py", line 23, in <module>
main_module_spec.loader.exec_module(main)
File "/var/azureml-app/score.py", line 8, in <module>
import cv2
File "/azureml-envs/azureml_659b55e5b05510a45f41f0ca31d3ac02/lib/python3.6/site-packages/cv2/__init__.py", line 5, in <module>
from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
Worker exiting (pid: 41)

最佳答案

您可以访问要安装的节点的终端吗?
如果是,请执行以下步骤:

sudo apt update
sudo apt install libgl1-mesa-glx

关于python - 在Azure Kubernetes服务中部署时导入cv2错误-python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64554615/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com