pythonjupyter-notebookbotorch

cannot import name "fit_gpytorch_model" from "botorch_fit"


I am trying to import fit_gpytorch_model from botorch or botorch.fit (whichever it should be from), but neither is working. I am following the procedures in a youtube video called "Coding Bayesian Optimization (Bayes Opt) with BOTORCH - Python example for hyperparameter tuning," at time 12:10. The specific error and code is given below, if anyone has experience with botorch or knows any info about potential updates that may have impacted this. Thank you.

ImportError                               Traceback (most recent call last)
Cell In[54], line 1
----> 1 from botorch.fit import fit_gpytorch_model
      3 fit_gpytorch_model(mll)

ImportError: cannot import name 'fit_gpytorch_model' from 'botorch.fit' (C:\Users\liuna\anaconda3\Lib\site-packages\botorch\fit.py)

Mostly as described above.


Solution

  • It looks like it was removed in March this year. The commit in question is tagged as 0.11.0 so if you downgrade your botorch version to 0.10.0 it will probably work