agimus-project / happypose

Toolbox and trackers for object pose-estimation. Based on the work CosyPose and MegaPose
https://agimus-project.github.io/happypose/
BSD 2-Clause "Simplified" License
22 stars 8 forks source link

Tests based on panda3d bug when chosing the device #146

Open ElliotMaitre opened 6 months ago

ElliotMaitre commented 6 months ago

When running test on a device with cuda available, we want to test that it both works on GPU and CPU. In this case, different problem arise when running the tests. Problematic tests are test_renderer_panda3d.py and test_megapose_inference.py.

In order to make the test run on a chosen device, I tried to modify some functions in the following way :

load_named_model, load_pose_models, Panda3dBatchRenderer, Panda3dSceneRenderer, App (i.e. Panda3d App) and the worker_loop of Panda3dBatchRenderer take device as input. Then, the different lines involving code such as if torch.cuda.is_available() is changed to use the selected device. This change seems to cause some issues :

For now, we decided to test only on GPU if a GPU is available, and on CPU if not.