"AttributeError: 'dict' object has no attribute 'figure'"
See original GitHub issueWhen I run the example in the tutorial, (https://nbviewer.jupyter.org/github/SheffieldML/notebook/blob/master/GPy/basic_gp.ipynb), I get the error below. My matplotlib version is 3.3.4
# test
X1 = np.random.uniform(-3.,3.,(20,1))
Y1 = np.sin(X1) + np.random.randn(20,1)*0.05
kernel = GPy.kern.RBF(input_dim=1, variance=1., lengthscale=1.)
m1 = GPy.models.GPRegression(X1,Y1,kernel)
fig = m1.plot()
GPy.plotting.show(fig, filename='basic_gp_regression_notebook')
> AttributeError Traceback (most recent call last)
> <ipython-input-61-e67b8a20cbc2> in <module>
> 1 fig = m1.plot()
> ----> 2 GPy.plotting.show(fig, filename='basic_gp_regression_notebook')
>
> ~\Anaconda3\envs\ml\lib\site-packages\GPy\plotting\__init__.py in show(figure, **kwargs)
> 148 for showing/drawing a figure.
> 149 """
> --> 150 return plotting_library().show_canvas(figure, **kwargs)
> 151
> 152
>
> ~\Anaconda3\envs\ml\lib\site-packages\GPy\plotting\matplot_dep\plot_definitions.py in show_canvas(self, ax, **kwargs)
> 94
> 95 def show_canvas(self, ax, **kwargs):
> ```
> ---> 96 ax.figure.canvas.draw()
> 97 return ax.figure
> 98
>
> AttributeError: 'dict' object has no attribute 'figure'
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
python - AttributeError: 'dict' object has no attribute 'predictors'
The AttributeError is an exception thrown when an object does not have the attribute you tried to access. The class dict does not...
Read more >AttributeError: 'dict' object has no attribute 'shape' #364 - GitHub
Hi! It looks like either 'nest_utils.get_outer_shape' or 'common.replicate' might have a bug on batched dictionary actions.
Read more >AttributeError: 'dict' object has no attribute 'value' - Treehouse
To get the value associated with a key, use the key as an index with square brackets (" student['topic'] ").
Read more >python tutorial: AttributeError: 'dict' object has no attribute 'value'
python tutorial: #codefix # python #python_tutorialAttributeError: ' dict ' object has no attribute 'value': In this video i have shared why ...
Read more >'dict' object has no attribute 'shape' - Report bugs - Edge Impulse
'dict' object has no attribute 'shape' ... My Neural Network gives this error while training it. ... @dansitu Looks like a bug. Any...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello.
Has this issue been resolved since it opened? The same error came up to me.
Thanks!
Thx, I have also fixed it as following: