#797 RuntimeError: [WinError 193] %1 不是有效的 Win32 应用程序。 Error loading

*162.108* Posted at: 1 day ago 👁15

语音识别阶段出错:[WinError 193] %1 不是有效的 Win32 应用程序。 Error loading "D:\BaiduNetdiskDownload\win-videotrans-v3.80\_internal\torch\lib\shm.dll" or one of its dependencies.[faster-whisper(本地)]:

Traceback (most recent call last):

File "videotrans\task\trans_create.py", line 375, in recogn

File "videotrans\recognition\__init__.py", line 249, in run

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "videotrans\recognition\_overall.py", line 11, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "videotrans\process\_overall.py", line 7, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "faster_whisper\__init__.py", line 2, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "faster_whisper\transcribe.py", line 13, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\__init__.py", line 55, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\converters\__init__.py", line 1, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\converters\converter.py", line 8, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\specs\__init__.py", line 1, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\specs\attention_spec.py", line 5, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\specs\common_spec.py", line 3, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "ctranslate2\specs\model_spec.py", line 18, in

File "", line 1027, in _find_and_load

File "", line 1006, in _find_and_load_unlocked

File "", line 688, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 457, in exec_module

File "torch\__init__.py", line 270, in

_load_dll_libraries()

File "torch\__init__.py", line 253, in _load_dll_libraries

raise err

OSError: [WinError 193] %1 不是有效的 Win32 应用程序。 Error loading "D:\BaiduNetdiskDownload\win-videotrans-v3.80\_internal\torch\lib\shm.dll" or one of its dependencies.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "videotrans\task\job.py", line 97, in run

File "videotrans\task\trans_create.py", line 411, in recogn

RuntimeError: [WinError 193] %1 不是有效的 Win32 应用程序。 Error loading "D:\BaiduNetdiskDownload\win-videotrans-v3.80\_internal\torch\lib\shm.dll" or one of its dependencies.

=====

Windows-10-10.0.19044-SP0

version:v3.80

frozen:True

language:zh

1 Replies

本条内容由 DeepSeek 回复
这是一个与 pyVideoTrans 软件直接相关的问题,错误发生在语音识别阶段,具体是 faster-whisper 本地模式加载 PyTorch 的动态链接库 shm.dll 时失败,提示“不是有效的 Win32 应用程序”。这通常意味着软件包内包含的 PyTorch 库与您的 Windows 系统架构(32位或64位)不兼容。

核心原因与解决方案:

您使用的预打包版本 win-videotrans-v3.80 很可能内置了与您系统不兼容的 PyTorch 库。最常见的情况是,您的系统是 64 位的,但软件包内包含了 32 位的 PyTorch 组件(或者反之)。

请按以下步骤尝试解决:

1. 重新下载并验证软件包:

  • 请前往 pyVideoTrans 的官方下载页面 (https://pyvideotrans.com/downpackage)。
  • 确保您下载的是与您操作系统架构匹配的版本。 对于现代的 Windows 10/11 电脑,几乎都是 64 位系统,请选择标注为 64位 的版本进行下载。
  • 下载后,建议将软件解压或安装到一个路径简单且无中文或特殊字符的文件夹中,例如 D:\pyVideoTrans。这可以避免因路径过长或包含特殊字符导致的潜在问题。

2. (如果问题依旧)尝试使用其他语音识别渠道:

  • 在彻底解决 PyTorch 兼容性问题之前,您可以暂时使用不依赖本地 PyTorch 的在线语音识别服务。
  • 在软件的“语音识别设置”中,将识别渠道从 “faster-whisper(本地)” 切换为其他在线渠道,例如:
  • 阿里FunASR中文识别(对中文效果较好,无需科学上网)
  • 字节火山字幕生成(需自行申请 API)
  • 这样可以在不解决本地库问题的前提下,继续使用软件的核心功能。

3. (进阶选项)源码部署:

  • 如果上述方法均无效,并且您熟悉 Python 环境,可以考虑通过源码方式部署 pyVideoTrans。这样可以确保在您的系统上编译和安装正确版本的依赖库(包括 PyTorch)。
  • 源码和部署说明请在 GitHub 仓库 (https://github.com/jianchang512/pyvideotrans) 查看。

总结:

最可能且最简单的解决方法是第一步:重新从官网下载正确的 64 位版本软件。这通常能直接解决因预编译包架构不匹配导致的 DLL 加载错误。

如果问题在尝试后依然存在,请提供软件目录下 logs 文件夹中最新日期的 .log 文件末尾部分,以便进行更深入的分析。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions