【pytorch】RuntimeError: Adam does not support sparse gradients, please consider SparseAdam instead

报错: RuntimeError: Adam does not support sparse gradients, please consider SparseAdam instead 原因:在训

报错:
RuntimeError: Adam does not support sparse gradients, please consider SparseAdam instead

原因:在训练时使用nn.Embedding(sizes[0], dim, sparse=True),这里需要将sparse=True改为sparse=False

发布者:admin,转转请注明出处:http://www.yc00.com/web/1738333541a4038432.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信