orbital-materials / orb-models

ORB forcefield models from Orbital Materials
Apache License 2.0
190 stars 22 forks source link

orb_v1() got an unexpected keyword argument 'device' #19

Closed wuziqiqiqi closed 1 month ago

wuziqiqiqi commented 1 month ago

I was running

from orb_models.forcefield import pretrained
orbff = pretrained.orb_v1(device='cuda')

and get an error saying orb_v1() got an unexpected keyword argument 'device' I was running it on Linux and with torch 2.2.0+cu121. Any suggestions on what might be the problem?

wuziqiqiqi commented 1 month ago

doing

import torch
torch.set_default_device('cuda')
orbff = pretrained.orb_v1()

seems to mitigate the issue, but it's still weird that I can't do orbff = pretrained.orb_v1(device='cuda')

p.s. This is a recent installation using

pip install orb-models
pip install "pynanoflann@git+https://github.com/dwastberg/pynanoflann#egg=af434039ae14bedcbb838a7808924d6689274168",
benrhodes26 commented 1 month ago

This is fixed in the latest version 0.3.2. Could you try pip install --upgrade orb_models?