Hi. I am running into this issue whenever I try to run the 4th cell in the notebook from week 1 (as seen in screenshot).
I have tried running the notebook kernel several times on Conda virtual environment as well as on Docker and always get the same result.
Could it be a compatibility issue? For what its worth I am using a MacBook Pro M1.
I tried running the notebook on Google Colab and it works perfectly. Is there a way to fix so I could run it on my computer too?
As you mentioned it works on colab and I also tried on my Mac Intel, it is running fine.
I would suggest, taking each of the lines (modifying for completion) and try it out.
Unfortunately, I do not have access to Mac M1
After some research it looks like TF version 2.4 is M1 compatible. Could you try manually changing the version in requirements.txt from tensorflow==2.3.1 to tensorflow==2.4.1 and let me know if it works? This for the conda environment method since to update the library within the Docker image the setup is more complicated. If you already have the virtual env created you can just activate it and run pip install tensorflow==2.4.1.
I tried each line of it, and figured out that: every time running “import cvlib as cv”, or “import tensorflow”, the kernel dies.
For tensorflow issue, I have manually changd the version in requirements.txt from tensorflow==2.3.1 to tensorflow==2.4.1, it did not work.
For cvlib issue, I have tried “pip install cvlib”, and it returned “Requirement already satisfied”. Then I restart the kernel and try to import cvlib again, the kernel still dies every time I try.
Besides, I have tried to build a new virtual environment and install tensorflow, cv2, cvlib module. Then I run week 1’s ungraded lab with the new venv, it works ok.
However, it’s actually a satisfying but not happy solution, because I need to install almost every module it need for every assignment, not as handy as Docker.
Hi @fabioantonini, thanks for your suggestion.
I have tried that, and it did not work on Mac M1.
Then I check Tensorflow’s official document, and figure out pip installation does not support Mac M1 yet. So I guess installing in virtual environment is the only way to use tensorflow for Mac M1 users by now.
Now I have two ways to deal with the exercises that I wanna practice locally:
For those modules can be installed in Mac M1, I code with virtual environment.
For those modules can not be installed in Mac M1, I code with Google Colab.
The embarrassed situation may be improved when MacOS 12.0 officially releases in later this year, which would be more compatible with machine learning stuff.
Ok, I am back in the game, and still have same problem. I now have MacOS 12.4 and still doesn’t work. M1 has huge problems not just with this particular issue, but I have also noticed in many other issues. I am not happy that deeplearning.ai hasn’t added a note on this lab, that we should not attempt with apple m1 computers. It would save a lot of time if they included this in the notebook. ANYONE WHO HAS APPLE M1 (AT THIS TIME), DO NOT NOT DO THIS LAB LOCALLY.
Until a month or so ago, the only way to run this lab was locally. Now there is a coursera version of it which should be used by mac M1 users. Will add a note about this
Anyone having difficulties setting up this lab on Apple M1 hardware as of mid-2022, check out esterjk’s solution here: Apple Mac M1 chip - #18 by estherjk