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
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?
Also Liked
fidus-Achates
I had the same problem using matplotlib 3. 7. 2.
with
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
instead of
ax = plt.figure().gca(projection="3d")
it works.
Thanks for all the additional code and explanations completing this excellent book!
Claudia
1
Popular Pragmatic Bookshelf topics
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84:
bundle exec sequel...
New
Hi Brian,
Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
Hello Brian,
I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
New
Hi everyone!
There is an error on the page 71 in the book “Programming machine learning from coding to depp learning” P. Perrotta. You c...
New
Title: Hands-on Rust: question about get_component (page 295)
(feel free to respond. “You dug you’re own hole… good luck”)
I have somet...
New
Hi! I know not the intentions behind this narrative when called, on page XI:
mount() |> handle_event() |> render()
but the correc...
New
Is the book’s epub format available to read on Google Play Books?
New
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
root_layout: {PentoWeb.LayoutView, :root},
This results in the following following error:
no “root” html template defined for PentoWeb...
New
I’ve got to the end of Ch. 11, and the app runs, with all tabs displaying what they should – at first. After switching around between St...
New
Other popular topics
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it.
Does your monitor have eye p...
New
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor?
Also, I want to know if someone is using it for program...
New
poll
poll
Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
Do the test and post your score :nerd_face:
:keyboard:
If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
Hello,
I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New
Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /ruby
- /wasm
- /erlang
- /phoenix
- /keyboards
- /rails
- /python
- /js
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /svelte
- /onivim
- /typescript
- /kotlin
- /c-plus-plus
- /crystal
- /tailwind
- /react
- /gleam
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /opensuse
- /html
- /centos
- /php
- /deepseek
- /zig
- /scala
- /sublime-text
- /lisp
- /textmate
- /react-native
- /nixos
- /debian
- /agda
- /kubuntu
- /arch-linux
- /django
- /revery
- /ubuntu
- /manjaro
- /deno
- /spring
- /nodejs
- /diversity
- /lua
- /julia
- /slackware
- /c






