generatebio / chroma

A generative model for programmable protein design
Apache License 2.0
627 stars 74 forks source link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! #46

Closed ppxwwtaking closed 4 months ago

ppxwwtaking commented 4 months ago

I run the following redesign code

Redesign a Protein

from chroma import Protein, Chroma chroma = Chroma() protein = Protein('1GFP') protein = chroma.design(protein) protein.to("1GFP-redesign.cif")

It comes with errors (attached). errors.txt

ppxwwtaking commented 4 months ago

I did not have any problems before today I run "apt --fix-broken install" to fix some inconsistency issue.

Here is the apt log file (attached). history.log

ppxwwtaking commented 4 months ago

The problem happens when chroma.design() is used. I found cuda was not available before the nvidia driver was updated, therefore all tensors used 'cpu'. Now cuda is available, the RuntimeError persists; there is no problem with other examples except for the redesign.

wujiewang commented 4 months ago

hey,

have you tried protein = Protein('1GFP', device='cuda')?

ppxwwtaking commented 4 months ago

hey,

have you tried protein = Protein('1GFP', device='cuda')?

Thanks. It works now. I thought somewhere I should specify the device, but I could not find chroma.design.