bert-event-extraction icon indicating copy to clipboard operation
bert-event-extraction copied to clipboard

TypeError: new() received an invalid combination of arguments - got (NoneType, int), but expected one of: * (*, torch.device device)

Open alwayslikethat opened this issue 4 years ago • 0 comments

Traceback (most recent call last): File "D:/pythonProject/bert-event-extraction-master/train.py", line 80, in model = Net( File "D:\pythonProject\bert-event-extraction-master\model.py", line 18, in init self.entity_embed = MultiLabelEmbeddingLayer(num_embeddings=entity_size, embedding_dim=entity_embedding_dim, device=device) File "D:\pythonProject\bert-event-extraction-master\model.py", line 129, in init self.matrix = nn.Embedding(num_embeddings=num_embeddings, File "D:\anaconda2020\lib\site-packages\torch\nn\modules\sparse.py", line 109, in init self.weight = Parameter(torch.Tensor(num_embeddings, embedding_dim)) TypeError: new() received an invalid combination of arguments - got (NoneType, int), but expected one of:

  • (*, torch.device device) didn't match because some of the arguments have invalid types: (!NoneType!, !int!)
  • (torch.Storage storage)
  • (Tensor other)
  • (tuple of ints size, *, torch.device device)
  • (object data, *, torch.device device)

alwayslikethat avatar Nov 09 '21 01:11 alwayslikethat