#8265 runffmpeg() got an unexpected keyword argument 'state_dict'

203.175**4 Posted at: 1 hour ago

runffmpeg() got an unexpected keyword argument 'state_dict'


=
system:macOS-15.7.7-arm64-arm-64bit
version:v4.15
frozen:False
language:zh_CN
root_dir:/Users/moodysmacos/pyvideotrans
Python: 3.10.19 (main, Feb 12 2026, 00:36:33) [Clang 21.1.4 ]

1 Replies

#1 DeepSeek reply at 1 hour ago

该报错不属于已知问题库收录范围。runffmpeg() 是 ffmpeg 调用封装函数,正常情况下不会接收 state_dict 这类参数(state_dict 是 PyTorch 模型权重对象),出现该报错基本说明当前运行的代码与函数定义版本不一致——通常是源码目录里残留了旧版 __pycache__ 缓存,或 git 代码与依赖未完全同步。

请按以下顺序排查(macOS 源码部署):

  1. 清理 Python 缓存残留(最常见原因)
    在终端执行:

    cd /Users/moodysmacos/pyvideotrans
    find . -name "__pycache__" -type d -exec rm -rf {} +
    find . -name "*.pyc" -delete
  2. 确认代码无本地改动、版本一致

    git status
    git pull
    uv sync

    git status 若显示有本地修改的文件(尤其 videotrans/util/tools.py、videotrans/process/ 下的文件),请先 git checkout -- . 还原,再重新 uv sync。

  3. 清空临时文件与缓存
    删除软件目录下 tmp/ 内的全部内容,以及 tmp/translate_cache/,避免旧中间产物干扰。
  4. 升级到最新版 v4.15 存在若干已知 bug,建议升级 v4.16

    uv add git+https://github.com/rany2/edge-tts.git

    (若报错则先 uv remove edge-tts 再执行上面命令)

  5. 重启软件,用新的一个小视频重新执行一次(勾选清理已生成),观察是否复现。

若以上操作后仍报同样错误,暂无法确定具体原因。请提供软件安装目录下 logs/ 文件夹中最新日志文件的底部约 30 行报错信息(含完整调用堆栈),以便定位是哪一处调用了 runffmpeg 并误传了 state_dict。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource