Skip to content

'NoneType' object has no attribute 't' #8

@schonkopf

Description

@schonkopf

While running the following codes:
net = NMF(data.shape, rank=self.basis_num, W=torch.Tensor(self.W), trainable_W=False).cuda()
net.fit(data.cuda(), verbose=True, max_iter=200, tol=1e-18, beta=1)

I received the error message, any idea?
/content/pytorchNMF/torchnmf/nmf.py in fit(self, V, beta, tol, max_iter, verbose, alpha, l1_ratio)
281
282 with torch.no_grad():
--> 283 WH = self.reconstruct(H, W)
284 loss_init = previous_loss = beta_div(WH, V, beta).mul(2).sqrt().item()
285

/content/pytorchNMF/torchnmf/nmf.py in reconstruct(H, W)
486 @staticmethod
487 def reconstruct(H, W):
--> 488 return F.linear(H, W)
489
490

/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py in linear(input, weight, bias)
1690 ret = torch.addmm(bias, input, weight.t())
1691 else:
-> 1692 output = input.matmul(weight.t())
1693 if bias is not None:
1694 output += bias

AttributeError: 'NoneType' object has no attribute 't'

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions