A Shallow Neural Network in Keras

36 views
Skip to first unread message

Mel Smith

unread,
Oct 21, 2021, 11:04:57 AM10/21/21
to deep-learning-illustrated
I am enjoying the book. Tried running the first example (5.1) in Colab but get this error:

ImportError: cannot import name 'SGD' from 'keras.optimizers' (/usr/local/lib/python3.7/dist-packages/keras/optimizers.py)

I had thought running through the examples in the cloud via Google Colab would automatically include all of the software dependencies.

Any ideas?

Mel Smith

unread,
Oct 21, 2021, 1:08:55 PM10/21/21
to deep-learning-illustrated
I am instead now following the "Step-by-Step Instructions for Windows", but I note that this step is missing for me:

"Right-click on the Docker "whale" icon in the system tray and select "Settings..." followed by "Shared Drives". Ensure that the drive which you used for the checkout is marked as shared; you will need to enter your Windows password and restart Docker at this point."

Specifically, there are no Shared Drives given. So I have continued without this step in the hope that it does not matter.

I am really hoping I can find a way to work through Part 2 of your book.

Jon Krohn

unread,
Oct 21, 2021, 2:33:45 PM10/21/21
to deep-learning-illustrated
Hi Melvyn! 

Delighted you're enjoying the book so far.

If you'd like to make updates to the "Step-by-Step Instructions for Windows" page, feel free to make a pull request and we'll review it!

Colab now uses TensorFlow 2.x while we wrote the book for TensorFlow 1.x. You can resolve the error you're seeing by either checking out Example 14.1 in the book (see page 323) or using the analogous, updated notebooks in this GitHub repo.

All my best,
Jon

Reply all
Reply to author
Forward
0 new messages