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

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) #5

Closed
JiajieLi7012 opened this issue Apr 14, 2024 · 3 comments

Comments

@JiajieLi7012
Copy link

I got the following error when training the model with the provided preprocessed bearPNG data:

Traceback (most recent call last):                                                                          
  File "exp_runner.py", line 480, in <module>                                                               
    runner.train_rnb()                                                                                      
  File "exp_runner.py", line 195, in train_rnb                                                                                                                                                                          
    self.validate_image()                                                                                   
  File "exp_runner.py", line 300, in validate_image                                                         
    lights_dir = self.dataset.light_directions[idv, idl, pixels_y_batch, pixels_x_batch, :].cuda().unsqueeze(0)                                                                                                         
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) 
@bbrument
Copy link
Owner

Hi,
I think that might be a mistake that comes from the Pytorch version. I recently changed it in the "requirements.txt" file.
Now, it's v1.8.0 and I think it solves this issue. Let me know.

@JiajieLi7012
Copy link
Author

JiajieLi7012 commented Apr 15, 2024

Hi, I think that might be a mistake that comes from the Pytorch version. I recently changed it in the "requirements.txt" file. Now, it's v1.8.0 and I think it solves this issue. Let me know.

Hi, thanks for your quick reply. When I used the Pytorch of version 1.8.0, I immediately got the following error, which seems an issue with this version of Pytorch according to Google results:

Traceback (most recent call last):
  File "exp_runner.py", line 479, in <module>
    runner = Runner(args.conf, args.mode, args.case, args.is_continue, args.no_albedo)
  File "exp_runner.py", line 33, in __init__
    self.dataset = Dataset(self.conf['dataset'],no_albedo)
  File "/data/lijiaj/RNb-NeuS/models/dataset.py", line 164, in __init__
    self.intrinsics_all_inv = torch.inverse(self.intrinsics_all)  # [n_images, 4, 4]
RuntimeError: CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling `cublasCreate(handle)

@JiajieLi7012
Copy link
Author

Hi, I think that might be a mistake that comes from the Pytorch version. I recently changed it in the "requirements.txt" file. Now, it's v1.8.0 and I think it solves this issue. Let me know.

I solve the problem by downgrading the PyTorch to 1.7.0. Thanks for your quick reply and help again.

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

2 participants