报错: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)
发布了453 篇原创文章 · 获赞 155 · 访问量 23万+

猜你喜欢

转载自blog.csdn.net/zimiao552147572/article/details/105500329