arneschneuing / DiffSBDD

A Euclidean diffusion model for structure-based drug design.
MIT License
339 stars 74 forks source link

Error runtime #22

Closed amarye closed 1 year ago

amarye commented 1 year ago

When generate_ligands.py was running, I got an error.

Cloud you please help me to solve this problem?

diffsbdd

msako82 commented 1 year ago

I got the same error too.

I deleted the .cpu() in lines 809-810 of lightning_modules.py and the errors disappeared.

    # Build mol objects
    x = xh_lig[:, :self.x_dims].detach().cpu()
    atom_type = xh_lig[:, self.x_dims:].argmax(1).detach().cpu()

I changed the above as follows

    # Build mol objects
    x = xh_lig[:, :self.x_dims].detach()
    atom_type = xh_lig[:, self.x_dims:].argmax(1).detach()
amarye commented 1 year ago

Thank you @msako82. I changed the line in Jupyter Notebook from 'device = 'cuda' if torch.cuda.is_available() else 'cpu'' to 'device = torch.device("cpu")'.
It worked for me.

arneschneuing commented 1 year ago

Hello, thanks for your answers! Interestingly, this error didn't occur in my environment but this commit should fix the issue for everyone.