-
Notifications
You must be signed in to change notification settings - Fork 259
Getting an error when running myBopt.plot_acquisition() from tutorial #355
Comments
I had a same error, and successfully fixed as follows. |
Hi, I downgraded the verison to 3.1.3 as describe above. here is an error code. AttributeError Traceback (most recent call last) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/GPyOpt/core/bo.py in plot_acquisition(self, filename, label_x, label_y) /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/GPyOpt/plotting/plots_bo.py in plot_acquisition(bounds, input_dim, model, Xdata, Ydata, acquisition_function, suggested_sample, filename, label_x, label_y, color_by_step) AttributeError: 'GPRegression' object has no attribute 'plot_density' can anyone tell what is wrong with the code below? domain = [{'name': 'var_1', 'type': 'continuous', 'domain': (-5,4)}] |
Help us please, the same error here |
help please |
Hi, just in case anyone is still looking for ways to resolve this. I tried this suggestion of using matplotlib 3.1.3, and it worked! Here are the steps I did in my Jupyter. My computer has Python 3.9 and I think matplotlib 3.1.3 needs Python 3.6.
import sys I finally have the "opt.plot_acquisition()" working! |
Just by running the tutorial on my notebook I get an error when it comes to run
myBopt.plot_acquisition()
The error:
`Traceback (most recent call last):
File "C:\Users\hp\Desktop\PHD\Projects\untitled3.py", line 33, in
myBopt.plot_acquisition()
File "C:\Users\hp\anaconda3\lib\site-packages\GPyOpt\core\bo.py", line 284, in plot_acquisition
return plot_acquisition(self.acquisition.space.get_bounds(),
File "C:\Users\hp\anaconda3\lib\site-packages\GPyOpt\plotting\plots_bo.py", line 64, in plot_acquisition
model.plot_density(bounds[0], alpha=.5)
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\gpy_plot\gp_plots.py", line 257, in plot_density
plots = _plot_density(self, canvas, helper_data, helper_prediction, label, **kwargs)
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\gpy_plot\gp_plots.py", line 271, in _plot_density
fills.append(pl().fill_gradient(
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\matplot_dep\plot_definitions.py", line 244, in fill_gradient
ax._process_unit_info(xdata=X, ydata=y1)
TypeError: _process_unit_info() got an unexpected keyword argument 'xdata'
runcell(0, 'C:/Users/hp/Desktop/PHD/Projects/untitled3.py')
Traceback (most recent call last):
File "C:\Users\hp\Desktop\PHD\Projects\untitled3.py", line 33, in
myBopt.plot_acquisition()
File "C:\Users\hp\anaconda3\lib\site-packages\GPyOpt\core\bo.py", line 284, in plot_acquisition
return plot_acquisition(self.acquisition.space.get_bounds(),
File "C:\Users\hp\anaconda3\lib\site-packages\GPyOpt\plotting\plots_bo.py", line 64, in plot_acquisition
model.plot_density(bounds[0], alpha=.5)
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\gpy_plot\gp_plots.py", line 257, in plot_density
plots = _plot_density(self, canvas, helper_data, helper_prediction, label, **kwargs)
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\gpy_plot\gp_plots.py", line 271, in _plot_density
fills.append(pl().fill_gradient(
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\matplot_dep\plot_definitions.py", line 244, in fill_gradient
ax._process_unit_info(xdata=X, ydata=y1)
TypeError: _process_unit_info() got an unexpected keyword argument 'xdata'
runcell(0, 'C:/Users/hp/Desktop/PHD/Projects/untitled3.py')
Traceback (most recent call last):
File "C:\Users\hp\Desktop\PHD\Projects\untitled3.py", line 33, in
myBopt.plot_acquisition()
File "C:\Users\hp\anaconda3\lib\site-packages\GPyOpt\core\bo.py", line 284, in plot_acquisition
return plot_acquisition(self.acquisition.space.get_bounds(),
File "C:\Users\hp\anaconda3\lib\site-packages\GPyOpt\plotting\plots_bo.py", line 64, in plot_acquisition
model.plot_density(bounds[0], alpha=.5)
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\gpy_plot\gp_plots.py", line 257, in plot_density
plots = _plot_density(self, canvas, helper_data, helper_prediction, label, **kwargs)
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\gpy_plot\gp_plots.py", line 271, in _plot_density
fills.append(pl().fill_gradient(
File "C:\Users\hp\anaconda3\lib\site-packages\GPy\plotting\matplot_dep\plot_definitions.py", line 244, in fill_gradient
ax._process_unit_info(xdata=X, ydata=y1)
TypeError: _process_unit_info() got an unexpected keyword argument 'xdata`
The text was updated successfully, but these errors were encountered: