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

InputDataError in botorch_bo #3

Open
michael-boese opened this issue Nov 23, 2022 · 1 comment
Open

InputDataError in botorch_bo #3

michael-boese opened this issue Nov 23, 2022 · 1 comment

Comments

@michael-boese
Copy link

Botorch_bo algorithm returns InputDataError when running it with Silly environment.

  File "/Users/xfeloper/.conda/envs/badger/lib/python3.9/site-packages/badger/gui_acr/components/routine_runner.py", line 51, in run
    run_routine(self.routine, True, self.save, self.verbose,
  File "/Users/xfeloper/.conda/envs/badger/lib/python3.9/site-packages/badger/core.py", line 333, in run_routine
    raise e
  File "/Users/xfeloper/.conda/envs/badger/lib/python3.9/site-packages/badger/core.py", line 330, in run_routine
    optimize(evaluate, configs)
  File "/Users/xfeloper/user/boese/badger/Badger-Plugins/algorithms/botorch_bo/__init__.py", line 34, in optimize
    x_new, _ = get_BO_point(train_X, train_Y, bounds, beta=beta)
  File "/Users/xfeloper/user/boese/badger/Badger-Plugins/algorithms/botorch_bo/__init__.py", line 68, in get_BO_point
    gp = botorch.models.SingleTaskGP(x, f)  # , precision)
  File "/Users/xfeloper/.conda/envs/badger/lib/python3.9/site-packages/botorch/models/gp_regression.py", line 122, in __init__
    self._validate_tensor_args(X=transformed_X, Y=train_Y)
  File "/Users/xfeloper/.conda/envs/badger/lib/python3.9/site-packages/botorch/models/gpytorch.py", line 106, in _validate_tensor_args
    raise InputDataError(
botorch.exceptions.errors.InputDataError: Expected all inputs to share the same dtype. Got torch.float32 for X, torch.float64 for Y, and None for Yvar.

Casting the values into float solves the problem but returns following warning:

/Users/xfeloper/.conda/envs/badger/lib/python3.9/site-packages/botorch/models/gpytorch.py:113: UserWarning: The model inputs are of type torch.float32. It is strongly recommended to use double precision in BoTorch, as this improves both precision and stability and can help avoid numerical errors.
@wenatuhs
Copy link
Contributor

wenatuhs commented Feb 2, 2023

Hi Michael, thanks for reporting this and I'm so sorry for the delayed response. This issue should be fixed in commit 6cc909c, could you please verify that the issue is gone? Many thanks!

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