uci-cbcl / UFold

MIT License
59 stars 29 forks source link

Running on CPU #9

Open rkruegs123 opened 2 years ago

rkruegs123 commented 2 years ago

Hi, when running the test code on a CPU I got the following error: AttributeError: module 'torch._C' has no attribute '_cuda_setDevice'

I am guessing that the code assumes that one has a GPU, but I don't see much reason for this if I am just using a pre-trained model for inference.

sperfu commented 2 years ago

Hi,

I guess it's because you only run the code on CPU. In that case, you can alter the code: https://github.com/uci-cbcl/UFold/blob/2b5fab25748c2ec6ce39d5b7e5d32a3c78b850de/ufold_predict.py#L297 to:

  device = torch.device("cpu")

to avoid this issue.

Please have a try.

Thanks

IseultLeahy commented 1 year ago

Hey, I've been getting the same error message and tried your solution but unfortunately it didn't change anything...

https://github.com/uci-cbcl/UFold/blob/2b5fab25748c2ec6ce39d5b7e5d32a3c78b850de/ufold_predict.py#L297

to:

  device = torch.device("cpu")