Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Error when evaluating the model for NYU Depth V2 #38

Open
manju838 opened this issue May 12, 2023 · 0 comments
Open

Runtime Error when evaluating the model for NYU Depth V2 #38

manju838 opened this issue May 12, 2023 · 0 comments

Comments

@manju838
Copy link

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument max in method wrapper_clamp_Tensor)

We get this error when running the following command as in instructions:
python ./code/test.py --dataset nyudepthv2 --data_path ./datasets/ --ckpt_dir <path_for_ckpt> --do_evaluate --max_depth 10.0 --max_depth_eval 10.0

The workaround is to add device parameter in line 294 of MIM-Depth-Estimation/models/swin_transformer_v2.py as shown below:

logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01, device=self.logit_scale.device))).exp()
Please correct this issue

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

No branches or pull requests

1 participant