torchdrug icon indicating copy to clipboard operation
torchdrug copied to clipboard

Error when running the molecule generation tutorial

Open liusulin opened this issue 2 years ago • 6 comments

When following the molecule generation tutorial in https://torchdrug.ai/docs/tutorials/generation.html, I got the following error when running the following code to generate with the pretrained GCPNresults = task.generate(num_sample=32, max_resample=5). Here is the error message: ***/torchdrug/data/graph.py", line 1171, in _check_attribute raise ValueError("Expect node attribute %sto have shape (%d, *), but found %s" % ValueError: Expect node attributeatom_feature to have shape (64, *), but found torch.Size([32, 18]) Could you kindly check and provide any help?

liusulin avatar Jun 23 '22 06:06 liusulin

I'm experiencing the same issue. I also tried to downgrade to Torch 1.9.0 but the issue is still occurring. Any suggestion on how to fix it? Thank you!

joaoplay avatar Jul 02 '22 12:07 joaoplay

I'm experiencing the same issue. I also tried to downgrade to Torch 1.9.0 but the issue is still occurring. Any suggestion on how to fix it? Thank you!

I was able to run it by downgrading TorchDrug to v0.1.2, but I didn't have enough time to find out what is the exact issue for v0.1.3. Hope this is helpful!

liusulin avatar Jul 02 '22 16:07 liusulin

I'm experiencing the same issue. I also tried to downgrade to Torch 1.9.0 but the issue is still occurring. Any suggestion on how to fix it? Thank you!

I was able to run it by downgrading TorchDrug to v0.1.2, but I didn't have enough time to find out what is the exact issue for v0.1.3. Hope this is helpful!

@liusulin Thank you! I'm now able to run it using:

  • torchdrug=0.1.2
  • python=3.8.13
  • torch-scatter=2.0.9
  • torch=1.11.0

Unfortunately, v0.1.2 doesn't have an integration with Weights & Biases, as well as many other improvements already in v0.1.3. It would be great that someone could fix it :pray:

joaoplay avatar Jul 04 '22 11:07 joaoplay

Thanks for pointing that out. It looks like a bug for v0.1.3. We will have a look at that.

KiddoZhu avatar Jul 04 '22 18:07 KiddoZhu

@KiddoZhu Do you have any estimation of when the fix is available? After downgrading to v1.0.2 I got stuck in old bugs already fixed in v1.0.3. For example:

File "/usr/local/lib/python3.8/dist-packages/torchdrug/data/graph.py", line 1212, in __getitem__ if count.max() > 1: RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.

It is now fixed in v1.0.3 after you've added if self.batch_size > 0 and count.max() > 1:.

Finally, the integration with Weights & Biases is a great feature, but only available in v1.0.3. I kindly ask your effort to help in fixing the GCPN tutorial as soon as possible. It would be great if you could give some guidelines on how to fix it.

Thank you very much!

joaoplay avatar Jul 05 '22 14:07 joaoplay

I believe that this issue should be fixed on current master

jannisborn avatar Aug 15 '22 12:08 jannisborn