Skip to content

fix: conf.cuda() causes CPU/CUDA device mismatch - #124

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/tsdf-optimizer-conf-cuda-causes-cpu-cuda-device
Open

fix: conf.cuda() causes CPU/CUDA device mismatch#124
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/tsdf-optimizer-conf-cuda-causes-cpu-cuda-device

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

Problem

fix: conf.cuda() causes CPU/CUDA device mismatch

Fix

Replace:

            depths[ni] = depth[imc[:, 1], imc[:, 0]]
            confs[ni] = conf.cuda()[imc[:, 1], imc[:, 0]]
        return depths, confs, valids

with:

            depths[ni] = depth[imc[:, 1], imc[:, 0]]
            confs[ni] = conf.to(imc.device)[imc[:, 1], imc[:, 0]]
        return depths, confs, valids

Files changed

  • mast3r/cloud_opt/tsdf_optimizer.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant