日萌社
人工智能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)