Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can I run cpu mode to generate linkers? #10

Open
wenchangzhou-qtx opened this issue Apr 15, 2024 · 1 comment
Open

can I run cpu mode to generate linkers? #10

wenchangzhou-qtx opened this issue Apr 15, 2024 · 1 comment

Comments

@wenchangzhou-qtx
Copy link

Hey, is it possible to run cpu mode? I saw it's possible from the generate.py, but when I tried I got this error:

python -W ignore /home/softwares/DiffLinker/generate.py --fragments frag.sdf --model models/geom_difflinker.ckpt --linker_size models/geom_size_gnn.ckpt --anchors 9,19
Will generate linkers with sampled numbers of atoms
Sampling...
  0%|                                                                                                  | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "/home/softwares/DiffLinker/generate.py", line 187, in <module>
    main(
  File "/home/softwares/DiffLinker/generate.py", line 156, in main
    chain, node_mask = ddpm.sample_chain(data, sample_fn=sample_fn, keep_frames=1)
  File "/home/softwares/DiffLinker/src/lightning.py", line 449, in sample_chain
    chain = self.edm.sample_chain(
  File "/home/softwares/mambaforge3/envs/difflinker/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/softwares/DiffLinker/src/edm.py", line 152, in sample_chain
    z = self.sample_p_zs_given_zt_only_linker(
  File "/home/softwares/DiffLinker/src/edm.py", line 188, in sample_p_zs_given_zt_only_linker
    eps_hat = self.dynamics.forward(
  File "/home/softwares/DiffLinker/src/egnn.py", line 383, in forward
    edges = self.get_edges(n_nodes, bs)  # (2, B*N)
  File "/home/softwares/DiffLinker/src/egnn.py", line 464, in get_edges
    return self.get_edges(n_nodes, batch_size)
  File "/home/softwares/DiffLinker/src/egnn.py", line 459, in get_edges
    edges = [torch.LongTensor(rows).to(self.device), torch.LongTensor(cols).to(self.device)]
  File "/home/softwares/mambaforge3/envs/difflinker/lib/python3.10/site-packages/torch/cuda/__init__.py", line 216, in _lazy_init
    torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available

@corinwagen
Copy link

Ditto here, I get some weird issues on CPU. The pre-trained models worked well for me, but I had to manually override a variety of "device" settings to force PyTorch not to try and use a non-existent CUDA device.

I'm guessing there's some settings being cached in the pre-trained models that aren't updated when they're loaded in generate.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants