關于使用 讀光-文字檢測-DBNet行檢測模型-中英-通用領域,版本問題
pip install modelscope
Successfully installed certifi-2025.4.26 charset-normalizer-3.4.1 colorama-0.4.6 idna-3.10 modelscope-1.25.0 requests-2.32.3 tqdm-4.67.1 urllib3-2.4.0
pip install numpy
Successfully installed numpy-2.2.5
pip install packaging
Successfully installed packaging-25.0
pip install addict
Successfully installed addict-2.4.0
pip install setuptools
Successfully installed setuptools-79.0.1
pip install datasets
Successfully installed aiohappyeyeballs-2.6.1 aiohttp-3.11.18 aiosignal-1.3.2 attrs-25.3.0 datasets-3.5.0 dill-0.3.8 filelock-3.18.0 frozenlist-1.6.0 fsspec-2024.12.0 huggingface-hub-0.30.2 multidict-6.4.3 multiprocess-0.70.16 pandas-2.2.3 propcache-0.3.1 pyarrow-19.0.1 python-dateutil-2.9.0.post0 pytz-2025.2 pyyaml-6.0.2 six-1.17.0 typing-extensions-4.13.2 tzdata-2025.2 xxhash-3.5.0 yarl-1.20.0
如果用了最新版本還是不能運行就用下面的版本再次嘗試
卸載所有版本
pip uninstall -y modelscope numpy packaging addict setuptools datasets
安裝指定版本
pip install modelscope==1.11.0 numpy==2.1.3 packaging==24.2 addict==2.4.0 setuptools==79.0.0 datasets==2.14.6
安裝完成后,報錯:
ModuleNotFoundError: No module named ‘torch’
就訪問下面鏈接
https://pytorch.org/
選擇自己適合的類型,我這用的CPU做演示,所以就選了 windows + pip + python + cpu
pip install torch torchvision torchaudio
Successfully installed MarkupSafe-3.0.2 jinja2-3.1.6 mpmath-1.3.0 networkx-3.4.2 sympy-1.13.3 torch-2.7.0 torchaudio-2.7.0 torchvision-0.22.0
如果還遇到報錯就按下面一個一個加上去:
pip install transformers
Successfully installed regex-2024.11.6 safetensors-0.5.3 tokenizers-0.21.1 transformers-4.51.3
pip install sentencepiece
Successfully installed sentencepiece-0.2.0
pip install opencv-python
Successfully installed opencv-python-4.11.0.86
pip install tf_slim
Successfully installed absl-py-2.2.2 tf_slim-1.1.0
pip install tensorflow
pip install pyclipper
pip install shapely