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

Error launching software! Help! #490

Closed rinbebong94 closed 3 weeks ago

rinbebong94 commented 4 weeks ago

Does anyone know how to solve this problem when I open the software? Screenshot 2024-06-18 144615

bropines commented 4 weeks ago

Does anyone know how to solve this problem when I open the software? Screenshot 2024-06-18 144615

What method did you use to install it?

I-love-study commented 3 weeks ago

I have the same issue when I first time running from source code. It's seems that program did not download every model it need. And now the program need alphabet-all-v7.txt but there's still alphabet-all-v5.txt in dev branch. The way to solve it is to download data folder from MEGA or Google Drive

Here is the log:

E:\Code\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.11.9 (tags/v3.11.9:de54cf5, Apr  2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
py executable:  E:\Code\BallonsTranslator\.venv\scripts\python.exe
version: 1.4.0
branch: dev
Commit hash: e79705a6b61ecd3d8506d56652a373797fdf6c55
[INFO   ] download_util:try_download_files:260 - downloading E:\Code\BallonsTranslator\.btrans_cache\windows_patchmatch_libs.7z from https://github.com/dmMaze/PyPatchMatchInpaint/releases/download/v1.0/windows_patchmatch_libs.7z ...
100%|█████████████████████████████████████████████████████████████████████████████| 11.8M/11.8M [00:02<00:00, 4.91MB/s]
[INFO   ] download_util:download_and_check_files:347 - Extracting E:\Code\BallonsTranslator\.btrans_cache\windows_patchmatch_libs.7z ...
[INFO   ] download_util:try_download_files:260 - downloading data/models/aot_inpainter.ckpt from https://github.com/zyddnys/manga-image-translator/releases/download/beta-0.3/inpainting.ckpt ...
100%|█████████████████████████████████████████████████████████████████████████████| 21.7M/21.7M [00:03<00:00, 5.94MB/s]
[INFO   ] download_util:try_download_files:260 - downloading data/models/lama_mpe.ckpt from https://github.com/zyddnys/manga-image-translator/releases/download/beta-0.3/inpainting_lama_mpe.ckpt ...
100%|███████████████████████████████████████████████████████████████████████████████| 104M/104M [00:13<00:00, 8.17MB/s]
[INFO   ] download_util:try_download_files:260 - downloading data/models/lama_large_512px.ckpt from https://huggingface.co/dreMaz/AnimeMangaInpainting/resolve/main/lama_large_512px.ckpt ...
100%|███████████████████████████████████████████████████████████████████████████████| 195M/195M [00:24<00:00, 8.36MB/s]
[INFO   ] download_util:try_download_files:260 - downloading E:\Code\BallonsTranslator\.btrans_cache\postag.zip from https://github.com/lancopku/pkuseg-python/releases/download/v0.0.16/postag.zip ...
100%|█████████████████████████████████████████████████████████████████████████████| 39.5M/39.5M [00:05<00:00, 7.50MB/s]
[INFO   ] download_util:download_and_check_files:347 - Extracting E:\Code\BallonsTranslator\.btrans_cache\postag.zip ...
[INFO   ] download_util:try_download_files:260 - downloading E:\Code\BallonsTranslator\.btrans_cache\spacy_ontonotes.zip from https://github.com/explosion/spacy-pkuseg/releases/download/v0.0.26/spacy_ontonotes.zip ...
100%|█████████████████████████████████████████████████████████████████████████████| 33.0M/33.0M [00:05<00:00, 6.21MB/s]
[INFO   ] download_util:download_and_check_files:347 - Extracting E:\Code\BallonsTranslator\.btrans_cache\spacy_ontonotes.zip ...
[INFO   ] launch:main:184 - QT_API: pyqt6, QT Version: 6.6.1
[INFO   ] launch:main:215 - set display language to zh_CN
[ERROR  ] __init__:create_error_dialog:29 - [Errno 2] No such file or directory: 'data/alphabet-all-v7.txt'
Failed to set module.

[ERROR  ] __init__:create_error_dialog:30 - Traceback (most recent call last):
  File "E:\Code\BallonsTranslator\ui\module_manager.py", line 57, in _set_module
    self.module.load_model()
  File "E:\Code\BallonsTranslator\modules\base.py", line 129, in load_model
    self._load_model()
  File "E:\Code\BallonsTranslator\modules\ocr\ocr_mit.py", line 91, in _load_model
    self.model = Model48pxOCR(OCR48PXMODEL_PATH, self.device)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\modules\ocr\mit48px.py", line 130, in __init__
    with open('data/alphabet-all-v7.txt', 'r', encoding = 'utf-8') as fp:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'data/alphabet-all-v7.txt'

Exception ignored in: <function BaseModule.__del__ at 0x000002294C8805E0>
Traceback (most recent call last):
  File "E:\Code\BallonsTranslator\modules\base.py", line 144, in __del__
[ERROR  ] __init__:create_error_dialog:29 - [Errno 2] No such file or directory: 'data/models/comictextdetector.pt'
Failed to set module.

[ERROR  ] __init__:create_error_dialog:30 - Traceback (most recent call last):
  File "E:\Code\BallonsTranslator\ui\module_manager.py", line 57, in _set_module
    self.module.load_model()
  File "E:\Code\BallonsTranslator\modules\base.py", line 129, in load_model
    self._load_model()
  File "E:\Code\BallonsTranslator\modules\textdetector\detector_ctd.py", line 50, in _load_model
    self.model = load_ctd_model(CTD_TORCH_PATH, self.device, self.detect_size)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\modules\textdetector\detector_ctd.py", line 11, in load_ctd_model
    model = CTDModel(model_path, detect_size=detect_size, device=device)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\modules\textdetector\ctd\inference.py", line 270, in __init__
    self.load_model(model_path)
  File "E:\Code\BallonsTranslator\modules\textdetector\ctd\inference.py", line 279, in load_model
    self.net = TextDetBase(model_path, device=self.device, act='leaky', half=self.half)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\modules\textdetector\ctd\basemodel.py", line 218, in __init__
    self.blk_det, self.text_seg, self.text_det = get_base_det_models(model_path, device, half, act=act)
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\modules\textdetector\ctd\basemodel.py", line 205, in get_base_det_models
    textdetector_dict = torch.load(model_path, map_location='cpu')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\.venv\Lib\site-packages\torch\serialization.py", line 997, in load
    with _open_file_like(f, 'rb') as opened_file:
         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\.venv\Lib\site-packages\torch\serialization.py", line 444, in _open_file_like
    return _open_file(name_or_buffer, mode)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Code\BallonsTranslator\.venv\Lib\site-packages\torch\serialization.py", line 425, in __init__
    super().__init__(open(name, mode))
                     ^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'data/models/comictextdetector.pt'

    self.unload_model()
  File "E:\Code\BallonsTranslator\modules\base.py", line 116, in unload_model
    model = getattr(self, k)
            ^^^^^^^^^^^^^^^^
AttributeError: 'OCRMIT48px' object has no attribute 'model'
[INFO   ] module_manager:on_finish_settranslator:903 - Translator set to google
[INFO   ] module_manager:on_finish_setinpainter:895 - Inpainter set to lama_large_512px
dmMaze commented 3 weeks ago

@rinbebong94 Please update to the latest (run scripts/local_gitpull.bat or redownload the package