yongqyu / MolGAN-pytorch

Pytroch implementation of MolGAN: An implicit generative model for small molecular graphs (https://arxiv.org/abs/1805.11973)
164 stars 42 forks source link

'numpy.ndarray' object has no attribute 'dim' #8

Open kulasimu opened 4 years ago

kulasimu commented 4 years ago

Hi, when I try to run the program with test mode, the error occurs. It shows 'numpy.ndarray' object has no attribute 'dim'. The error is located at solver.py, line 376, "edges_logits, nodes_logits = self.G(z)" I tried several solutions on google but they didn't work. Could someone tell me what's the problem?

yateeshagrawal commented 3 years ago

In "def test(self):", z needs to be converted to torch tensor. So simply add "z = torch.from_numpy(z).to(self.device).float()" in a new line just after "z = self.sample_z(a.shape[0])".