sbi: RuntimeError Expected all tensors to be on the same device at append_simulations
I made sure that input tensors to append_simulations be on cuda, but still have an error.
>>>theta.is_cuda
True
>>>x.is_cuda
True
device = "cuda"
inference = SNPE(prior, density_estimator, device)
inference = inference.append_simulations(theta, x) # error appeares here
density_estimator = inference.train()
raise RuntimeError(rte, message)
RuntimeError: (RuntimeError('Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking arugment for argument mat1 in method wrapper_addmm)'), '')
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (9 by maintainers)
shouldn’t that read
append_simulations(theta_, x_)?The following works for me:
Maybe the issue got fixed along the way? Feel free to reopen if the issue persists on the latest version of
sbi.