Shallow net in Keras on M1 Macbook

77 views
Skip to first unread message

Pablo

unread,
Aug 10, 2022, 8:36:35 AM8/10/22
to deep-learning-illustrated
Hi Jon,
I´m greatly enjoying your book!
Unfortunately I get this error message when I run the shallow_net_in_keras notebook through docker:

F tensorflow/core/platform/cpu_feature_guard.cc:36] The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
qemu: uncaught target signal 6 (Aborted) - core dumped

I have an M1 Macbook Pro (2021) running the latest Version of macOS Monterey (12.5), I followed the instructions for the Mac installation of the notebooks.
It works in Colab, but I´m on my vacation and don´t have access to Wi-Fi for another two weeks, so I would love to run the notebooks offline.

Any ideas what might be the solution?

Greetings
Pablo

deep-learning-illustrated

unread,
Aug 10, 2022, 11:03:54 AM8/10/22
to deep-learning-illustrated
Hi Pablo!

Ah yeah, this sounds like it could potentially be M1 Mac related. I wonder if you used the code, installation instructions, and Dockerfile from this more recent repo of mine instead if that would help? There are analogous Jupyter notebooks to everything in the "official" Deep Learning Illustrated repo, including the Shallow Net notebook you mentioned (in the new repo it's Shallow Net in TensorFlow instead of Shallow Net in Keras, but other than imports, the code's identical).

Best,
Jon

Pablo

unread,
Aug 12, 2022, 7:34:08 AM8/12/22
to deep-learning-illustrated
Hi Jon,

Thanks a lot for the quick reply!
Unfortunately I wasn't able to install the new repo, it's getting stuck at "Building wheel for grpcio (setup.py)" while building the docker image. I waited for 10 minutes, restarted the laptop, reinstalled docker, but still the same problem.

Weirdly enough I have the same problem now when I try to rebuild the original repo, which got deleted when I uninstalled Docker, the first time I installed this everything went smoothly (except for running the notebooks).
If I try pulling the image from Docker (instead of building it) there is no error message, but when I try to run it I get "Unable to find image 'dli-stack:latest' locally".

What am I doing wrong?

Greetings
Pablo

deep-learning-illustrated

unread,
Aug 12, 2022, 9:05:47 AM8/12/22
to deep-learning-illustrated
Hi Pablo! 

I'm afraid you're at the mercy of StackOverflow/Google searches now. I've never encountered anything like these errors before :(

Wish I could help more,
Jon

Pablo

unread,
Aug 15, 2022, 6:48:11 AM8/15/22
to deep-learning-illustrated
Hi Jon,

So I managed to install the new repo (with the help of a friend who has much more experience in coding than me 😅).
After downloading the repo I followed the installation instructions, but added a few lines to the Dockerfile in the downloaded repo folder before building the docker image:

# Install TensorFlow:
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install tensorflow==2.0.0

... and after the very last line:

RUN pip install markupsafe==2.0.1

With this the installation worked just fine. Unfortunately I still get the same error message when running the Shallow net in Tensorflow ("The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine."), but the Shallow net in Pytorch seems to work just fine. That´s already some progress! Next I´ll try to make the tensorflow notebooks work on my machine as well (maybe you have an idea what the problem might be?).

All the best
Pablo
Reply all
Reply to author
Forward
0 new messages