Closed GuyTevet closed 3 years ago
Thanks for the pointer. You must still transfer the loss to your GPU via .to(device)
:
self_contact_module = SelfContact(essentials_folder=essentials)
self_contact_loss = SelfContactLoss(self_contact_module, use_hd=False, align_faces=False).to('cuda')
self_contact_loss(vertices.to(self_contact_loss.device))
It works! many thanks:)
btw, is it possible to run with use_hd=True
(currently fails with the error below)
Traceback (most recent call last):
File "/disk2/guytevet/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
exec(exp, global_vars, local_vars)
File "<input>", line 1, in <module>
File "/disk2/guytevet/venvs/py3.7_vibe/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/disk2/guytevet/selfcontact/selfcontact/losses/general_selfcontact_loss.py", line 80, in forward
test_segments=self.test_segments
File "/disk2/guytevet/selfcontact/selfcontact/selfcontact.py", line 214, in segment_vertices
vertices, v2v_min, incontact, exterior, test_segments)
File "/disk2/guytevet/selfcontact/selfcontact/selfcontact.py", line 244, in segment_hd_points
hd_verts_ioc_idx = (self.geovec.unsqueeze(-1) == \
File "/disk2/guytevet/venvs/py3.7_vibe/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1131, in __getattr__
type(self).__name__, name))
AttributeError: 'SelfContact' object has no attribute 'geovec'
If you want to use hd, you also need to initialise the self-contact module with hd. You can do that by running:
self_contact_module = SelfContact(essentials_folder=essentials, compute_hd=True)
Thanks! closing.
Hi Lea!
Running:
Fails with:
From my understanding, this happens since the essentials are not loaded to
self_contact_loss.device
.Many Thanks,