docker环境中使用pip安装modelscope在某些服务器会出现cannot import name '_datasets_server' from 'datasets.utils' (/usr/local/lib/python3.8/dist-packages/datasets/utils/__init__.py)错误
Describe the bug
Python 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.
from modelscope.utils.constant import Tasks 2024-04-24 14:47:30,503 - modelscope - INFO - PyTorch version 1.13.1+cu116 Found. 2024-04-24 14:47:30,504 - modelscope - INFO - Loading ast index from /root/.cache/modelscope/ast_indexer 2024-04-24 14:47:30,548 - modelscope - INFO - Loading done! Current index file version is 1.13.3, with md5 044a8f5dcefc3d184ee392721fd6f58c and a total number of 972 components indexed from modelscope.pipelines import pipeline Traceback (most recent call last): File "
", line 1, in File "/usr/local/lib/python3.8/dist-packages/modelscope/pipelines/init.py", line 4, in from .base import Pipeline File "/usr/local/lib/python3.8/dist-packages/modelscope/pipelines/base.py", line 16, in from modelscope.msdatasets import MsDataset File "/usr/local/lib/python3.8/dist-packages/modelscope/msdatasets/init.py", line 2, in from .ms_dataset import MsDataset File "/usr/local/lib/python3.8/dist-packages/modelscope/msdatasets/ms_dataset.py", line 24, in from modelscope.msdatasets.utils.hf_datasets_util import
File "/usr/local/lib/python3.8/dist-packages/modelscope/msdatasets/utils/hf_datasets_util.py", line 42, infrom datasets.utils import _datasets_server, file_utils ImportError: cannot import name '_datasets_server' from 'datasets.utils' (/usr/local/lib/python3.8/dist-packages/datasets/utils/init.py)
To Reproduce run python3
Your Environments (required)
- OS: CentOS Linux release 7.9.2009 (Core) ,Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- CPU: Intel(R) Xeon(R) Silver 4314 CPU @ 2.40GHz
- Docker version 20.10.7, build f0df350
- NVIDIA-SMI 535.161.08 Driver Version: 535.161.08 CUDA Version: 12.2
- Dockerfile: FROM nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu20.04
WORKDIR /home/cloud
LABEL maintainer=“cloud"
ARG DEBIAN_FRONTEND=noninteractive
USER root
apt
RUN apt-get update &&
apt-get install -y vim apt-utils curl libpq-dev tzdata net-tools wget libgl1-mesa-glx libglib2.0-0
timezone
ENV LANG C.UTF-8 ENV TZ Asia/Shanghai RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN dpkg-reconfigure --frontend noninteractive tzdata
python
ARG PIP_MIRROR=https://mirrors.aliyun.com/pypi/simple/ RUN apt-get install -y software-properties-common RUN add-apt-repository ppa:deadsnakes/ppa RUN apt update RUN apt install python3.8 -y RUN apt install python3-pip -y RUN python3 -m pip install -i $PIP_MIRROR --no-cache-dir --upgrade pip
https://pytorch.org/get-started/previous-versions/
RUN pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 RUN python3 -m pip install --no-cache-dir modelscope -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir supervisor -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir opencv-python -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir uvicorn -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir fastapi -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir prettytable -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir yacs -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir pattern_singleton -i $PIP_MIRROR RUN python3 -m pip install --no-cache-dir Cython -i $PIP_MIRROR
- docker command:docker run -it --rm --name test --gpus "device=0" docker-image-name bash
Pipeline related: @Firmament-cyou @wenmengzhou
py37
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-1.6.1
py38
registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.5
使用以上两个镜像问题解决了,但是在nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu20.04环境上的报错还未找到原因
请尝试安装1.14.0版本
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.