Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker环境中使用pip安装modelscope在某些服务器会出现cannot import name '_datasets_server' from 'datasets.utils' (/usr/local/lib/python3.8/dist-packages/datasets/utils/__init__.py)错误 #841

Open
lydia7777777 opened this issue Apr 24, 2024 · 3 comments
Assignees
Labels

Comments

@lydia7777777
Copy link

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, in
from 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 feat: add citest #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

@lydia7777777
Copy link
Author

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环境上的报错还未找到原因

@wenmengzhou
Copy link
Collaborator

请尝试安装1.14.0版本

Copy link

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.

@github-actions github-actions bot added the Stale label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants