igashov / DiffLinker

DiffLinker: Equivariant 3D-Conditional Diffusion Model for Molecular Linker Design
MIT License
293 stars 40 forks source link

AttributeError: can't set attribute #3

Closed DimGorr closed 1 year ago

DimGorr commented 1 year ago

After using your weights and trying to find the linker of the fragment with the following code:

generate.main(
        input_path = "...generator_0.sdf",
        model = "models/geom_difflinker.ckpt",
        output_dir = "difflinker/output",
        n_samples = 2,
        n_steps = None,
        linker_size = "...difflinker/models/geom_size_gnn.ckpt",
        anchors = None)

I got the following error:

File "difflinker/src/egnn.py", line 134, in init self.device = device File "lib/python3.7/site-packages/torch/nn/modules/module.py", line 1317, in setattr super().setattr(name, value) AttributeError: can't set attribute

It was happening when I was trying to load the weights. After commenting parts with self.device = device in several files from src it started compiling properly. Please let me know I misunderstand smth or if you have experienced the same. Just in case I'm working with cuda if it might matter