You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用caer.preprocess_from_dir触发verbose flag参数错误该如何解决?

问题原因

你调用caer.preprocess_from_dir()方法时未传入必填的verbose参数,该参数用于控制预处理过程是否在终端输出进度日志,只能取值为0(不输出)或1(输出)。

修复方案

在调用方法的参数中补充verbose参数即可,根据你的需求二选一:

  • 需要查看预处理进度,就设置verbose=1
  • 不需要输出进度日志,就设置verbose=0

修改后的代码示例

需要输出进度的写法:

train = caer.preprocess_from_dir(char_path, characters, channels=channels, IMG_SIZE=IMG_SIZE, isShuffle=True, verbose=1)

不需要输出进度的写法:

train = caer.preprocess_from_dir(char_path, characters, channels=channels, IMG_SIZE=IMG_SIZE, isShuffle=True, verbose=0)

内容的提问来源于stack exchange,提问作者Epic Nemo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.02 00:54:02