dmMaze / BallonsTranslator

深度学习辅助漫画翻译工具, 支持一键机翻和简单的图像/文本编辑 | Yet another computer-aided comic/manga translation tool powered by deeplearning
GNU General Public License v3.0
2.25k stars 150 forks source link

tokenizers版本不对且无法修正 #474

Closed wjz2001 closed 1 month ago

wjz2001 commented 1 month ago

启动时显示错误ImportError: tokenizers>=0.14,<0.15 is required for a normal functioning of this module, but found tokenizers==0.13.3 我尝试删除ballontrans_pylibs_win里所有与tokenizers相关的文件夹,结果重新运行后又自动下载了0.13.3版本,然后错误就无法解决

dmMaze commented 1 month ago

没完整 log 不知道你 import 啥 error

wjz2001 commented 1 month ago

没完整 log 不知道你 import 啥 error

D:\BallonsTranslator\launch.py:10: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources py version: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] py executable: D:\BallonsTranslator\ballontrans_pylibs_win\python.exe version: 1.4.0 branch: dev Commit hash: b4adf9df4823b4e8ad334e627b2e800dc8e4c918 [INFO ] launch:main:184 - QT_API: pyqt6, QT Version: 6.7.1 Traceback (most recent call last): File "D:\BallonsTranslator\launch.py", line 291, in main() File "D:\BallonsTranslator\launch.py", line 200, in main load_modules() File "D:\BallonsTranslator\launch.py", line 119, in load_modules _load_module(**kwargs) File "D:\BallonsTranslator\launch.py", line 111, in _load_module importlib.import_module(module_path + module_name.replace('.py', '')) File "importlib__init__.py", line 126, in import_module File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\BallonsTranslator\modules\ocr\ocr_manga.py", line 4, in from transformers import AutoFeatureExtractor, AutoTokenizer, VisionEncoderDecoderModel File "D:\BallonsTranslator\ballontrans_pylibs_win\lib\site-packages\transformers__init__.py", line 26, in from . import dependency_versions_check File "D:\BallonsTranslator\ballontrans_pylibs_win\lib\site-packages\transformers\dependency_versions_check.py", line 57, in require_version_core(deps[pkg]) File "D:\BallonsTranslator\ballontrans_pylibs_win\lib\site-packages\transformers\utils\versions.py", line 117, in require_version_core return require_version(requirement, hint) File "D:\BallonsTranslator\ballontrans_pylibs_win\lib\site-packages\transformers\utils\versions.py", line 111, in require_version _compare_versions(op, got_ver, want_ver, requirement, pkg, hint) File "D:\BallonsTranslator\ballontrans_pylibs_win\lib\site-packages\transformers\utils\versions.py", line 44, in _compare_versions raise ImportError( ImportError: tokenizers>=0.14,<0.15 is required for a normal functioning of this module, but found tokenizers==0.13.3. Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main [INFO ] utils:dump_compile_times:247 - TorchDynamo compilation metrics: Function, Runtimes (s) [INFO ] utils:dump_compile_times:247 - TorchDynamo compilation metrics: Function, Runtimes (s) [2024-06-10 07:58:51,464] torch._dynamo.utils: [INFO] TorchDynamo compilation metrics: [2024-06-10 07:58:51,464] torch._dynamo.utils: [INFO] Function, Runtimes (s)

dmMaze commented 1 month ago

如果用网盘里的大包不会有版本冲突才对啊,你再 launch.bat 同目录下启动控制台输入

.\ballontrans_pylibs_win\python.exe -m pip show tokenizers

.\ballontrans_pylibs_win\python.exe -m pip show transformers

看看是什么结果

wjz2001 commented 1 month ago

如果用网盘里的大包不会有版本冲突才对啊,你再 launch.bat 同目录下启动控制台输入

.\ballontrans_pylibs_win\python.exe -m pip show tokenizers

.\ballontrans_pylibs_win\python.exe -m pip show transformers

看看是什么结果

Name: tokenizers Version: 0.13.3 Summary: Fast and Customizable Tokenizers Home-page: https://github.com/huggingface/tokenizers Author: Anthony MOI Author-email: anthony@huggingface.co License: Apache License 2.0 Location: d:\ballonstranslator\ballontrans_pylibs_win\lib\site-packages Requires: Required-by: transformers

Name: transformers Version: 4.29.2 Summary: State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: d:\ballonstranslator\ballontrans_pylibs_win\lib\site-packages Requires: filelock, huggingface-hub, numpy, packaging, pyyaml, regex, requests, tokenizers, tqdm Required-by:

dmMaze commented 1 month ago

@wjz2001 试试 .\ballontrans_pylibs_win\python.exe -m pip install -U transformers再启动,还不行就 .\ballontrans_pylibs_win\python.exe -m pip install -U tokenizers transformers

dmMaze commented 1 month ago

@wjz2001 你是没用那个大包,然后给 pip 配了什么镜像站吗

wjz2001 commented 1 month ago

.\ballontrans_pylibs_win\python.exe -m pip install -U tokenizers transformers

用了第二个命令成功启动,谢谢

wjz2001 commented 1 month ago

@wjz2001 你是没用那个大包,然后给 pip 配了什么镜像站吗

1用了,我从谷歌云盘下的。没配置镜像站