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

Not able to create file with CUDA because of torch 2.3 #213

Open
3 tasks done
py930828 opened this issue May 1, 2024 · 2 comments
Open
3 tasks done

Not able to create file with CUDA because of torch 2.3 #213

py930828 opened this issue May 1, 2024 · 2 comments

Comments

@py930828
Copy link

py930828 commented May 1, 2024

Checkboxes

  • I have read the installation and usage documents.
  • I have not found similar open/closed issue or disscussion.
  • Reboot doesn't fix the problem.

Describe the bug and copy the error message

I'm on windows 11,
CUDA version 12.1,
Worddumb 3.31.4

The error is torch can't find its dependencies. I searched online that this error might be caused by torch 2.3 and people can fix it by downgrade to 2.2, however I'm not sure how I can do it in worddumb-libs-py3.12 as I don't see virtual environment setup there.

Plugin settings and reproduce steps

{
"add_locator_map": false,
"choose_format_manually": true,
"cuda": "cu121",
"fandom": "",
"kindle_gloss_lang": "zh_cn",
"minimal_x_ray_count": 1,
"model_size": "lg",
"preferred_formats": [
"AZW3",
"MOBI",
"AZW",
"EPUB",
"KFX"
],
"python_path": "",
"remove_link_styles": false,
"search_people": true,
"use_all_formats": false,
"use_gpu": true,
"use_pos": true,
"use_wiktionary_for_kindle": true,
"wiktionary_gloss_lang": "zh_cn",
"zh_wiki_variant": "cn"
}

Generated files, screenshots or videos

Starting job: Generating Word Wise and X-Ray for A Case for Christ
Job: "Generating Word Wise and X-Ray for A Case for Christ" failed with error:
Traceback (most recent call last):
File "calibre\gui2\threaded_jobs.py", line 85, in start_work
File "calibre_plugins.worddumb.parse_job", line 201, in do_job
File "calibre_plugins.worddumb.utils", line 52, in run_subprocess
File "subprocess.py", line 571, in run
subprocess.CalledProcessError: Command '['python', 'C:\Users\cl930\AppData\Roaming\calibre\plugins\WordDumb.zip', '{"book_id": 148, "book_path": "F:\\Calibre\\Calibre Library\\Steve Hays\\A Case for Christ (148)\\A Case for Christ - Steve Hays.azw3", "mi": null, "book_fmt": "AZW3", "book_lang": "en", "useragent": "WordDumb/3.31.4 (https://github.com/xxyzz/WordDumb)", "plugin_path": "C:\\Users\\cl930\\AppData\\Roaming\\calibre\\plugins\\WordDumb.zip", "spacy_model": "en_core_web_trf", "create_ww": true, "create_x": true, "asin": "BBKMF8ZBLG", "acr": "A_Case_for_Christ", "revision": "07efc666", "kfx_json": null, "mobi_html": null, "mobi_codec": "utf-8"}', '{"use_pos": true, "search_people": true, "model_size": "lg", "zh_wiki_variant": "cn", "fandom": "", "add_locator_map": false, "preferred_formats": ["AZW3", "MOBI", "AZW", "EPUB", "KFX"], "use_all_formats": false, "minimal_x_ray_count": 1, "choose_format_manually": true, "wiktionary_gloss_lang": "zh_cn", "kindle_gloss_lang": "zh_cn", "use_gpu": true, "cuda": "cu121", "use_wiktionary_for_kindle": true, "remove_link_styles": false, "python_path": "", "ca_wiktionary_difficulty_limit": 5, "cs_wiktionary_difficulty_limit": 5, "da_wiktionary_difficulty_limit": 5, "de_wiktionary_difficulty_limit": 5, "el_wiktionary_difficulty_limit": 5, "en_wiktionary_difficulty_limit": 5, "es_wiktionary_difficulty_limit": 5, "fi_wiktionary_difficulty_limit": 5, "fr_wiktionary_difficulty_limit": 5, "he_wiktionary_difficulty_limit": 5, "hr_wiktionary_difficulty_limit": 5, "it_wiktionary_difficulty_limit": 5, "ja_wiktionary_difficulty_limit": 5, "ko_wiktionary_difficulty_limit": 5, "lt_wiktionary_difficulty_limit": 5, "mk_wiktionary_difficulty_limit": 5, "nl_wiktionary_difficulty_limit": 5, "no_wiktionary_difficulty_limit": 5, "pl_wiktionary_difficulty_limit": 5, "pt_wiktionary_difficulty_limit": 5, "ro_wiktionary_difficulty_limit": 5, "ru_wiktionary_difficulty_limit": 5, "sl_wiktionary_difficulty_limit": 5, "sv_wiktionary_difficulty_limit": 5, "uk_wiktionary_difficulty_limit": 5, "zh_wiktionary_difficulty_limit": 5}']' returned non-zero exit status 1.

Called with args: (ParseJobData(book_id=148, book_path='F:\Calibre\Calibre Library\Steve Hays\A Case for Christ (148)\A Case for Christ - Steve Hays.azw3', mi=<calibre.ebooks.metadata.book.base.Metadata object at 0x000001BB73A08190>, book_fmt='AZW3', book_lang='en', useragent='WordDumb/3.31.4 (https://github.com/xxyzz/WordDumb)', plugin_path='C:\Users\cl930\AppData\Roaming\calibre\plugins\WordDumb.zip', spacy_model='en_core_web_trf', create_ww=True, create_x=True, asin='BBKMF8ZBLG', acr='A_Case_for_Christ', revision='07efc666', kfx_json=None, mobi_html=None, mobi_codec='utf-8'),) {'notifications': <queue.Queue object at 0x000001BB73A0AB50>, 'abort': <threading.Event at 0x1bb73a3b4d0: unset>, 'log': <calibre.utils.logging.GUILog object at 0x000001BB73A3B1D0>}
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\WordDumb.zip_main
.py", line 37, in
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\WordDumb.zip\parse_job.py", line 227, in create_files
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\WordDumb.zip\parse_job.py", line 753, in load_spacy
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\spacy_init
.py", line 6, in
from .errors import setup_default_warnings
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\spacy\errors.py", line 3, in
from .compat import Literal
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\spacy\compat.py", line 4, in
from thinc.util import copy_array
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\thinc_init_.py", line 5, in
from .config import registry
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\thinc\config.py", line 5, in
from .types import Decorator
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\thinc\types.py", line 25, in
from .compat import cupy, has_cupy
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\thinc\compat.py", line 35, in
import torch
File "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\torch_init_.py", line 141, in
raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\cl930\AppData\Roaming\calibre\plugins\worddumb-libs-py3.12\torch\lib\shm.dll" or one of its dependencies.

@py930828 py930828 changed the title Not able to create file with CUDA Not able to create file with CUDA because of torch 2.3 May 1, 2024
@xxyzz
Copy link
Owner

xxyzz commented May 1, 2024

pytorch is downgraded to 2.2.2: f0a99d6

You can download the test plugin from here: https://github.com/xxyzz/WordDumb/actions/runs/8910601306

@py930828
Copy link
Author

py930828 commented May 1, 2024

Downgrade pytorch to 2.2.2 works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants