开发者社区 > 云原生 > Serverless > 正文

函数计算FC图生图 这个报错怎么解决?

函数计算FC图生图 这个报错怎么解决?NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.

展开
收起
三分钟热度的鱼 2024-01-17 16:35:52 515 0
1 条回答
写回答
取消 提交回答
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    这个报错是由于在Unet中生成了一个所有元素都是NaN的张量。这可能是由于图片精度不足,或者您的显卡不支持半精度类型(half type)。您可以尝试以下方法解决:

    1. 在设置中将“Upcast cross attention layer to float32”选项设置为True。具体操作如下:

      • 打开函数计算FC的控制台。
      • 点击左侧菜单栏中的“Settings”。
      • 在“Stable Diffusion”设置中找到“Upcast cross attention layer to float32”选项。
      • 将其设置为True。
    2. 使用命令行参数--no-half来禁用半精度类型。具体操作如下:

      • 打开函数计算FC的命令行界面。
      • 在命令行中添加--no-half参数。
      • 重新运行您的代码。
    3. 使用命令行参数--disable-nan-check来禁用NaN检查。具体操作如下:

      • 打开函数计算FC的命令行界面。
      • 在命令行中添加--disable-nan-check参数。
      • 重新运行您的代码。
    2024-01-17 20:23:55
    赞同 展开评论 打赏

快速交付实现商业价值。

相关产品

  • 函数计算
  • 热门讨论

    热门文章

    相关电子书

    更多
    Hologres Serverless之路:揭秘弹性计算组 立即下载
    Serverless开发平台: 让研发效能再提升 立即下载
    Serverless 引领云上研发新范式 立即下载