#545 openai.APIConnectionError: Connection error.

2a02:6ea0* Posted at: 1 month ago 👁98

连接API地址失败,请检查网络或代理: Connection error.:Traceback (most recent call last):

File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions

File "httpx\_transports\default.py", line 250, in handle_request

File "httpcore\_sync\connection_pool.py", line 216, in handle_request

File "httpcore\_sync\connection_pool.py", line 196, in handle_request

File "httpcore\_sync\http_proxy.py", line 289, in handle_request

File "httpcore\_sync\connection.py", line 99, in handle_request

File "httpcore\_sync\connection.py", line 76, in handle_request

File "httpcore\_sync\connection.py", line 154, in _connect

File "httpcore\_backends\sync.py", line 152, in start_tls

File "contextlib.py", line 153, in __exit__

File "httpcore\_exceptions.py", line 14, in map_exceptions

httpcore.ConnectError: EOF occurred in violation of protocol (_ssl.c:997)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "openai\_base_client.py", line 982, in request

File "httpx\_client.py", line 914, in send

File "httpx\_client.py", line 942, in _send_handling_auth

File "httpx\_client.py", line 979, in _send_handling_redirects

File "httpx\_client.py", line 1014, in _send_single_request

File "httpx\_transports\default.py", line 249, in handle_request

File "contextlib.py", line 153, in __exit__

File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions

httpx.ConnectError: EOF occurred in violation of protocol (_ssl.c:997)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "videotrans\util\TestSrtTrans.py", line 17, in run

File "videotrans\translator\__init__.py", line 853, in run

File "videotrans\translator\_base.py", line 81, in run

File "tenacity\__init__.py", line 480, in __call__

File "videotrans\translator\_deepseek.py", line 53, in _item_task

File "openai\_utils\_utils.py", line 287, in wrapper

File "openai\resources\chat\completions\completions.py", line 1150, in create

File "openai\_base_client.py", line 1259, in post

File "openai\_base_client.py", line 1014, in request

openai.APIConnectionError: Connection error.

=====

Windows-10-10.0.26100-SP0

version:v3.80

frozen:True

language:zh

9 Replies

Admin

查看是否填写或使用了代理,如果是,确保代理网络稳定,或者关掉代理后重试。

没有开代理,网页手动上传失败,显示

上传失败,请检查网络连接或服务器状态。

本条内容由 DeepSeek 回复

根据错误信息和开发者的回复,这是典型的网络连接问题。错误显示无法连接到 DeepSeek API 服务器。

解决方案:

  1. 检查网络连接:

    • 确保您的网络连接稳定
    • 尝试访问其他网站确认网络正常
  2. DeepSeek API 服务状态:

    • 错误信息表明 DeepSeek API 服务器可能暂时不可用
    • 建议等待一段时间后重试
  3. 临时解决方案:

    • 暂时切换到其他翻译渠道,如 Google 翻译或 Microsoft 翻译
    • 这些服务通常更稳定,可以作为替代方案
  4. 后续处理:

    • 如果问题持续存在,请稍后重试 DeepSeek 翻译
    • 确保您的 API 密钥正确且未过期

由于这是服务器端的连接问题,除了等待服务恢复或切换翻译渠道外,没有其他有效的解决方案。

这个问题是我使用parakeet-win-0707的时候产生的

本条内容由 gpt-5-mini 回复

您提到的 parakeet-win-0707 可能是您使用的 pyVideoTrans 版本或某个相关组件的名称。然而,根据您提供的错误日志,核心问题是 httpx.ConnectError: EOF occurred in violation of protocol (_ssl.c:997)openai.APIConnectionError: Connection error.,这表明在尝试连接到 DeepSeek 的 API 服务器时发生了 SSL/TLS 连接中断。

EOF occurred in violation of protocol 错误通常与以下几种情况有关:

  1. 网络或代理问题:

    • 代理配置不当或不稳定: 如果您配置了代理(例如在 videotrans/params.json 或系统网络设置中),请确保代理服务器稳定且能够正确访问 DeepSeek API。尝试暂时关闭代理后重试,或更换一个稳定的代理。
    • 网络连接不稳定: 您的本地网络可能存在间歇性问题,导致与 DeepSeek 服务器的连接中断。
    • 防火墙或安全软件: 本地防火墙或安全软件可能会阻止 pyVideoTrans 建立与外部 API 的 SSL 连接。
  2. SSL/TLS 协议兼容性问题: 虽然较少见,但您的系统或 Python 环境的 SSL/TLS 库版本可能与 DeepSeek API 服务器的要求不完全兼容,导致握手失败。通常,更新系统或 Python 环境能解决此类问题。
  3. DeepSeek API 服务器端问题: DeepSeek 服务器可能暂时出现故障、维护或过载,导致无法正常响应连接请求。

解决方案:

  1. 检查并调整代理设置 (最常见原因):

    • Admin 之前所说,请再次确认您是否使用了代理。在 pyVideoTrans 的菜单栏选择 菜单--翻译设置,检查 DeepSeek 的相关设置中是否有代理配置。
    • 如果使用了代理,尝试将其关闭,或者更换一个稳定可靠的代理服务器。
    • 如果没有使用代理,请确保您的网络环境可以直接访问 DeepSeek API 服务器。
  2. 检查网络连接:

    • 确保您的电脑网络连接稳定,尝试访问其他网站或服务,确认网络畅通。
  3. 稍后重试:

    • 由于这可能是 DeepSeek API 服务器的临时问题,建议您等待一段时间(例如几小时)后再次尝试。
  4. 切换翻译渠道 (临时解决方案):

    • 在问题解决之前,您可以暂时切换到其他翻译渠道,例如 GoogleMicrosoftDeepL 等,以继续您的视频翻译工作。
  5. 提供完整的日志文件:

    • 如果上述步骤都无法解决问题,请提供 软件根目录/logs/ 目录下最新的日志文件(以 {年月日}.log 格式命名),这将包含更详细的错误信息,有助于进一步分析。

现在又报错 错误: 服务器内部错误

本条内容由 gpt-5-mini 回复

您现在遇到的“错误: 服务器内部错误”提示,表明问题出在 DeepSeek 的 API 服务器端,而不是您本地的网络连接或软件配置。

这意味着 DeepSeek 服务器在处理您的翻译请求时,自身出现了故障或异常。这可能由以下原因引起:

  1. DeepSeek 服务器暂时故障或维护: API 服务器可能正在进行维护,或者遇到了突发性故障。
  2. 请求过载: 服务器可能在某个时间段内请求量过大,导致内部处理能力不足。
  3. 特定请求导致服务器问题: 您的某个翻译请求内容可能触发了服务器端的特定错误。

解决方案:

  1. 等待并重试: 这是最常见的解决方案。服务器内部错误通常是暂时的,建议您等待一段时间(例如几分钟到几小时)后再次尝试进行翻译。
  2. 切换翻译渠道: 作为临时的替代方案,您可以切换到其他翻译渠道(例如 Google、Microsoft、DeepL 或 OpenAI 等),以完成当前的翻译任务。
  3. 检查 DeepSeek 服务状态 (如果可能): 虽然我无法提供 DeepSeek 的官方状态页面链接,但通常大型服务提供商会有这样的页面,您可以尝试搜索确认 DeepSeek API 的运行状况。
  4. 提供日志文件: 如果在多次尝试后问题依然存在,请提供 videotrans/logs/ 目录下最新的日志文件。日志中可能会包含 DeepSeek API 返回的更详细错误代码或信息,这将有助于进一步分析。

服务器启动中...
访问前端页面: http://127.0.0.1:5092
API 端点: POST http://127.0.0.1:5092/v1/audio/transcriptions
服务将使用 4 个线程运行。
[c11e3286-36aa-42e3-a708-1e2c4d8869fb] 正在将 'JUL-887-nv-1760855855.983285.wav' 转换为标准 WAV 格式...
加载模型:parakeet-tdt_ctc-0.6b-ja
[NeMo I 2025-10-19 14:56:05 mixins:181] Tokenizer SentencePieceTokenizer initialized with 3072 tokens
[NeMo W 2025-10-19 14:56:08 modelPT:181] If you intend to do training or fine-tuning, please call the ModelPT.setup_training_data() method and provide a valid configuration file to setup the train data loader.

Train config :
manifest_filepath: null
sample_rate: 16000
batch_size: null
shuffle: true
num_workers: 8
pin_memory: true
max_duration: 30.0
min_duration: 0.1
is_tarred: true
tarred_audio_filepaths: null
shuffle_n: 2048
bucketing_strategy: fully_randomized
bucketing_batch_size: null
use_lhotse: true
use_bucketing: true
batch_duration: 600
quadratic_duration: 15
num_buckets: 30
bucket_duration_bins:
- 1.94375
- 2.55687
- 3.08312
- 3.57138
- 3.98812
- 4.36069
- 4.72375
- 5.078
- 5.434
- 5.78994
- 6.15175
- 6.5175
- 6.8885
- 7.26075
- 7.6495
- 8.05538
- 8.48038
- 8.92763
- 9.40019
- 9.90275
- 10.44594
- 11.04794
- 11.72106
- 12.49338
- 13.40481
- 14.50519
- 15.8975
- 17.80975
- 20.92788
bucket_buffer_size: 20000
shuffle_buffer_size: 10000

[NeMo W 2025-10-19 14:56:08 modelPT:188] If you intend to do validation, please call the ModelPT.setup_validation_data() or ModelPT.setup_multiple_validation_data() method and provide a valid configuration file to setup the validation data loader(s).

Validation config :
manifest_filepath: null
sample_rate: 16000
batch_size: null
shuffle: false
use_start_end_token: false
num_workers: 8
pin_memory: true
is_tarred: false
use_lhotse: true
use_bucketing: true
batch_duration: 600
quadratic_duration: 15
num_buckets: 10

[NeMo W 2025-10-19 14:56:08 modelPT:195] Please call the ModelPT.setup_test_data() or ModelPT.setup_multiple_test_data() method and provide a valid configuration file to setup the test data loader(s).

Test config :
manifest_filepath: null
sample_rate: 16000
batch_size: 256
shuffle: false
use_start_end_token: false
num_workers: 8
pin_memory: true

[NeMo I 2025-10-19 14:56:08 features:305] PADDING: 0
[NeMo I 2025-10-19 14:56:11 rnnt_models:226] Using RNNT Loss : tdt

Loss tdt_kwargs: {'fastemit_lambda': 0.0, 'clamp': -1.0, 'durations': [0, 1, 2, 3, 4], 'sigma': 0.05, 'omega': 0.1}

[NeMo I 2025-10-19 14:56:11 rnnt_models:226] Using RNNT Loss : tdt

Loss tdt_kwargs: {'fastemit_lambda': 0.0, 'clamp': -1.0, 'durations': [0, 1, 2, 3, 4], 'sigma': 0.05, 'omega': 0.1}

[NeMo W 2025-10-19 14:56:11 label_looping_base:109] No conditional node support for Cuda.

Cuda graphs with while loops are disabled, decoding speed will be slower
Reason: No `cuda-python` module. Please do `pip install cuda-python>=12.3`

[NeMo I 2025-10-19 14:56:12 rnnt_models:226] Using RNNT Loss : tdt

Loss tdt_kwargs: {'fastemit_lambda': 0.0, 'clamp': -1.0, 'durations': [0, 1, 2, 3, 4], 'sigma': 0.05, 'omega': 0.1}

[NeMo W 2025-10-19 14:56:12 label_looping_base:109] No conditional node support for Cuda.

Cuda graphs with while loops are disabled, decoding speed will be slower
Reason: No `cuda-python` module. Please do `pip install cuda-python>=12.3`

处理过程中发生严重错误: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

Traceback (most recent call last):
File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\app.py", line 180, in transcribe_audio

asr_model = nemo_asr.models.ASRModel.from_pretrained(model_name=f"nvidia/{model_list[language]}")

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\nemo\core\classes\common.py", line 822, in from_pretrained

instance = class_.restore_from(

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\nemo\core\classes\modelPT.py", line 493, in restore_from

instance = cls._save_restore_connector.restore_from(

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\nemo\core\connectors\save_restore_connector.py", line 267, in restore_from

loaded_params = self.load_config_and_state_dict(

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\nemo\core\connectors\save_restore_connector.py", line 189, in load_config_and_state_dict

instance = instance.to(map_location)

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\lightning\fabric\utilities\device_dtype_mixin.py", line 55, in to

return super().to(*args, **kwargs)

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\module.py", line 1355, in to

return self._apply(convert)

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\module.py", line 915, in _apply

module._apply(fn)

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\module.py", line 915, in _apply

module._apply(fn)

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\module.py", line 915, in _apply

module._apply(fn)

[Previous line repeated 1 more time]
File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\rnn.py", line 290, in _apply

self._init_flat_weights()

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\rnn.py", line 215, in _init_flat_weights

self.flatten_parameters()

File "E:\AI\Trans-Movie\win-videotrans\parakeet-win-0707\runtime./Lib/site-packages\torch\nn\modules\rnn.py", line 271, in flatten_parameters

torch._cudnn_rnn_flatten_weight(

RuntimeError: CUDA error: no kernel image is available for execution on the device
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
直接在网页上传,报错如下

您遇到的错误 CUDA error: no kernel image is available for execution on the device 表明您的 NVIDIA 显卡与当前 PyTorch/CUDA 环境不兼容。这通常发生在以下情况:

主要原因:

  • 您的显卡计算能力(Compute Capability)低于当前 PyTorch 版本支持的最低要求
  • CUDA 版本与显卡驱动不匹配
  • 显卡过旧(如 Maxwell 架构或更早的显卡)

解决方案:

  1. 检查显卡兼容性:

    • 查看您的显卡型号,确认其计算能力
    • 较旧的显卡(如 GTX 750 Ti、GTX 960 等)可能无法支持较新的 CUDA 版本
  2. 禁用 CUDA 加速:

    • 在 pyVideoTrans 的语音识别设置中,取消勾选 "CUDA加速" 选项
    • 这将强制使用 CPU 进行计算,虽然速度较慢,但可以正常运行
  3. 更新显卡驱动:

    • 前往 NVIDIA 官网下载并安装最新的显卡驱动程序
  4. 临时使用其他语音识别渠道:

    • 切换到 faster-whisper(本地)openai-whisper(本地) 等兼容性更好的语音识别模型
    • 这些模型对旧显卡的兼容性通常更好

由于错误明确指向 CUDA 内核镜像不可用,最直接的解决方案是禁用 CUDA 加速,让软件使用 CPU 进行计算。

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

Similar issues already exist

Trending Questions