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
Thanks for your error report and we appreciate it a lot.
Checklist
I have searched the tutorial on modelscope doc-site
I have searched related issues but cannot get the expected help.
The bug has not been fixed in the latest version.
Describe the bug
root@f3db3488eed3:/ocr/modelscope# python demo.py
2024-04-25 16:25:52,412 - modelscope - INFO - PyTorch version 1.11.0+cpu Found.
2024-04-25 16:25:52,415 - modelscope - INFO - Loading ast index from /mnt/workspace/.cache/modelscope/ast_indexer
2024-04-25 16:25:52,415 - modelscope - INFO - No valid ast index found from /mnt/workspace/.cache/modelscope/ast_indexer, generating ast index from prebuilt!
2024-04-25 16:25:52,526 - modelscope - INFO - AST-Scanning the path "/ocr/modelscope/modelscope" with the following sub folders ['models', 'metrics', 'pipelines', 'preprocessors', 'trainers', 'msdatasets', 'exporters']
2024-04-25 16:26:21,531 - modelscope - INFO - Scanning done! A number of 976 components indexed or updated! Time consumed 29.115567445755005s
2024-04-25 16:26:21,615 - modelscope - INFO - Loading done! Current index file version is 1.9.4, with md5 b2983ccde06655d34203dbe3e7355438 and a total number of 976 components indexed
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /ocr/modelscope/demo.py:1 in │
│ │
│ ❱ 1 from modelscope.pipelines import pipeline │
│ 2 from modelscope.utils.constant import Tasks │
│ 3 import cv2 │
│ 4 │
│ │
│ /ocr/modelscope/modelscope/pipelines/init.py:4 in │
│ │
│ 1 # Copyright (c) Alibaba, Inc. and its affiliates. │
│ 2 │
│ 3 from . import audio, cv, multi_modal, nlp │
│ ❱ 4 from .base import Pipeline │
│ 5 from .builder import pipeline │
│ 6 │
│ │
│ /ocr/modelscope/modelscope/pipelines/base.py:16 in │
│ │
│ 13 from packaging import version │
│ 14 │
│ 15 from modelscope.models.base import Model │
│ ❱ 16 from modelscope.msdatasets import MsDataset │
│ 17 from modelscope.outputs import TASK_OUTPUTS, ModelOutputBase │
│ 18 from modelscope.pipeline_inputs import TASK_INPUTS, check_input_type │
│ 19 from modelscope.preprocessors import Preprocessor │
│ │
│ /ocr/modelscope/modelscope/msdatasets/init.py:2 in │
│ │
│ 1 # Copyright (c) Alibaba, Inc. and its affiliates. │
│ ❱ 2 from .ms_dataset import MsDataset │
│ 3 │
│ │
│ /ocr/modelscope/modelscope/msdatasets/ms_dataset.py:24 in │
│ │
│ 21 from modelscope.msdatasets.dataset_cls.custom_datasets.builder import \ │
│ 22 │ build_custom_dataset │
│ 23 from modelscope.msdatasets.utils.delete_utils import DatasetDeleteManager │
│ ❱ 24 from modelscope.msdatasets.utils.hf_datasets_util import load_dataset_with_ctx │
│ 25 from modelscope.msdatasets.utils.upload_utils import DatasetUploadManager │
│ 26 from modelscope.preprocessors import build_preprocessor │
│ 27 from modelscope.utils.config import Config, ConfigDict │
│ │
│ /ocr/modelscope/modelscope/msdatasets/utils/hf_datasets_util.py:15 in │
│ │
│ 12 from urllib.parse import urlencode │
│ 13 │
│ 14 import requests │
│ ❱ 15 from datasets import (BuilderConfig, Dataset, DatasetBuilder, DatasetDict, │
│ 16 │ │ │ │ │ DownloadConfig, DownloadManager, DownloadMode, Features, │
│ 17 │ │ │ │ │ IterableDataset, IterableDatasetDict, Split, │
│ 18 │ │ │ │ │ VerificationMode, Version, config, data_files) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'VerificationMode' from 'datasets' (/opt/conda/lib/python3.7/site-packages/datasets/init.py)
To Reproduce
What command or script did you run?
Using docker environment: registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py37-torch1.11.0-tf1.15.5-1.6.1
Run python script:
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
import cv2
ocr_recognition = pipeline(Tasks.ocr_recognition, model='damo/cv_convnextTiny_ocr-recognition-general_damo')
### 使用url
img_url = 'http://duguang-labelling.oss-cn-shanghai.aliyuncs.com/mass_img_tmp_20220922/ocr_recognition.jpg'
result = ocr_recognition(img_url)
print(result)
Your Environments (required)
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
Please @ corresponding people according to your problem:
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug
root@f3db3488eed3:/ocr/modelscope# python demo.py
2024-04-25 16:25:52,412 - modelscope - INFO - PyTorch version 1.11.0+cpu Found.
2024-04-25 16:25:52,415 - modelscope - INFO - Loading ast index from /mnt/workspace/.cache/modelscope/ast_indexer
2024-04-25 16:25:52,415 - modelscope - INFO - No valid ast index found from /mnt/workspace/.cache/modelscope/ast_indexer, generating ast index from prebuilt!
2024-04-25 16:25:52,526 - modelscope - INFO - AST-Scanning the path "/ocr/modelscope/modelscope" with the following sub folders ['models', 'metrics', 'pipelines', 'preprocessors', 'trainers', 'msdatasets', 'exporters']
2024-04-25 16:26:21,531 - modelscope - INFO - Scanning done! A number of 976 components indexed or updated! Time consumed 29.115567445755005s
2024-04-25 16:26:21,615 - modelscope - INFO - Loading done! Current index file version is 1.9.4, with md5 b2983ccde06655d34203dbe3e7355438 and a total number of 976 components indexed
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /ocr/modelscope/demo.py:1 in │
│ │
│ ❱ 1 from modelscope.pipelines import pipeline │
│ 2 from modelscope.utils.constant import Tasks │
│ 3 import cv2 │
│ 4 │
│ │
│ /ocr/modelscope/modelscope/pipelines/init.py:4 in │
│ │
│ 1 # Copyright (c) Alibaba, Inc. and its affiliates. │
│ 2 │
│ 3 from . import audio, cv, multi_modal, nlp │
│ ❱ 4 from .base import Pipeline │
│ 5 from .builder import pipeline │
│ 6 │
│ │
│ /ocr/modelscope/modelscope/pipelines/base.py:16 in │
│ │
│ 13 from packaging import version │
│ 14 │
│ 15 from modelscope.models.base import Model │
│ ❱ 16 from modelscope.msdatasets import MsDataset │
│ 17 from modelscope.outputs import TASK_OUTPUTS, ModelOutputBase │
│ 18 from modelscope.pipeline_inputs import TASK_INPUTS, check_input_type │
│ 19 from modelscope.preprocessors import Preprocessor │
│ │
│ /ocr/modelscope/modelscope/msdatasets/init.py:2 in │
│ │
│ 1 # Copyright (c) Alibaba, Inc. and its affiliates. │
│ ❱ 2 from .ms_dataset import MsDataset │
│ 3 │
│ │
│ /ocr/modelscope/modelscope/msdatasets/ms_dataset.py:24 in │
│ │
│ 21 from modelscope.msdatasets.dataset_cls.custom_datasets.builder import \ │
│ 22 │ build_custom_dataset │
│ 23 from modelscope.msdatasets.utils.delete_utils import DatasetDeleteManager │
│ ❱ 24 from modelscope.msdatasets.utils.hf_datasets_util import load_dataset_with_ctx │
│ 25 from modelscope.msdatasets.utils.upload_utils import DatasetUploadManager │
│ 26 from modelscope.preprocessors import build_preprocessor │
│ 27 from modelscope.utils.config import Config, ConfigDict │
│ │
│ /ocr/modelscope/modelscope/msdatasets/utils/hf_datasets_util.py:15 in │
│ │
│ 12 from urllib.parse import urlencode │
│ 13 │
│ 14 import requests │
│ ❱ 15 from datasets import (BuilderConfig, Dataset, DatasetBuilder, DatasetDict, │
│ 16 │ │ │ │ │ DownloadConfig, DownloadManager, DownloadMode, Features, │
│ 17 │ │ │ │ │ IterableDataset, IterableDatasetDict, Split, │
│ 18 │ │ │ │ │ VerificationMode, Version, config, data_files) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'VerificationMode' from 'datasets' (/opt/conda/lib/python3.7/site-packages/datasets/init.py)
To Reproduce
What command or script did you run?
Using docker environment: registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-py37-torch1.11.0-tf1.15.5-1.6.1
Run python script:
Your Environments (required)
Please @ corresponding people according to your problem:
Model related: @wenmengzhou @tastelikefeet
Model hub related: @liuyhwangyh
Dataset releated: @wangxingjun778
Finetune related: @tastelikefeet @Jintao-Huang
Pipeline related: @Firmament-cyou @wenmengzhou
Contribute your model: @zzclynn
The text was updated successfully, but these errors were encountered: