欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-03-04 13:25:51
...

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

日萌社

人工智能AI:Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战(不定时更新)


 

        RuntimeError: Adam does not support sparse gradients, please consider SparseAdam instead
        分析:nn.Embedding(vocab_size, embed_dim, sparse=True)中不能等于True,必须为False
        解决:nn.Embedding(vocab_size, embed_dim, sparse=False)