ggerico

ggerico

Programming Machine Learning: some plot files are throwing error

I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1:

programming_ML/code/03_gradient:

$ python3 plot_loss_with_path.py
Traceback (most recent call last):
  File "/Users/germain/Code/lang/python/programming_ML/code/03_gradient/plot_loss_with_path.py", line 70, in <module>
    ax = plt.figure().gca(projection="3d")
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'
$ python3 plot_loss_with_slices.py
Traceback (most recent call last):
  File "/Users/germain/Code/lang/python/programming_ML/code/03_gradient/plot_loss_with_slices.py", line 70, in <module>
    ax = plt.figure().gca(projection="3d")
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'

programming_ML/code/04_hyperspace :

$ python3 plot_plane.py
Traceback (most recent call last):
  File "/Users/germain/Code/lang/python/programming_ML/code/04_hyperspace/plot_plane.py", line 17, in <module>
    ax = plt.figure().gca(projection="3d")
TypeError: FigureBase.gca() got an unexpected keyword argument 'projection'

There is a fix ?
tks˜

Marked As Solved

nusco

nusco

Author of Metaprogramming Ruby & Programming Machine Learning

Hey, @ggerico. Did you follow the instructions to set up the right libraries? The ones in the book are potentially outdated, so I recommend these ones.

If you still have the problem after following the instructions on progml.com, then it’s something that I should look into. In that case, could you please let me know?

Popular Prag Prog topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
New
johnp
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
New
AufHe
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
New
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
New

Other popular topics Top

AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
New
AstonJ
Chris Seaton, the creator of TruffleRuby has died. It appears from suicide :cry: He left this note on Twitter on the weekend: And one...
New

Latest in PragProg

View all threads ❯