Search code examples
gpytorch

GPytorch Runtime Error has different input types


I am following the simple regression tutorial on gpytorch and get the following error when trying to use 2 dimensional input space during a call to the loss function.

RuntimeError: !(has_different_input_dtypes && !config.promote_inputs_to_common_dtype_ && (has_undefined_outputs || config.enforce_safe_casting_to_output_ || config.cast_common_dtype_to_outputs_)) INTERNAL ASSERT FAILED at "../aten/src/ATen/TensorIterator.cpp":405, please report a bug to PyTorch. 

I am not quite sure what it means. Everything but the training data is still: https://github.com/cornellius-gp/gpytorch/blob/master/examples/01_Exact_GPs/Simple_GP_Regression.ipynb


Solution

  • The issue was my conversion of torch tensor.

    I used: torch.from_numpy(array) Instead I should use: torch.tensor(array)

    This is weird, but no issues now.