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

AIGC训练营有没有能解决的下这个提示?

AIGC训练营有没有能解决的下这个提示?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.Time taken:%C2%A03.29sTorch active/reserved: 4008/4056 MiB,%C2%A0Sys VRAM: 4203/14961 MiB (28.09%)image.png

展开
收起
cuicuicuic 2023-06-24 17:05:32 1341 0
1 条回答
写回答
取消 提交回答
  • 根据您提供的错误提示,这个问题是由于在Unet中生成了包含NaN(Not a Number)的张量导致的。这可能是由于精度不足或显卡不支持half类型所引起的。您可以尝试以下解决方法:

    设置“Upcast cross attention layer to float32”选项:在Stable Diffusion的设置中,找到“Upcast cross attention layer to float32”选项并启用它。这将使交叉注意力层的数据类型转换为float32,从而解决精度不足的问题。

    使用--no-half命令行参数:在命令行中运行训练脚本时,添加--no-half参数。例如:

    ```python train.py --no-half

    
    这将禁用half类型,确保使用float32类型进行计算。
    
    使用--disable-nan-check命令行参数:在命令行中运行训练脚本时,添加--disable-nan-check参数。例如:
    ```python train.py --disable-nan-check
    

    这将禁用NaN检查,但请注意,禁用此检查可能会导致无效数据的计算,因此谨慎使用。

    请根据您的具体情况选择适合的解决方案。如果问题仍然存在或您需要更进一步的帮助,请联系AIGC训练营的支持团队或相关技术支持渠道,以获取更准确和个性化的指导。

    2023-10-20 15:23:55
    赞同 展开评论 打赏
问答地址:

快速交付实现商业价值。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载