Jupyter Notebook Kernel dies when importing tenserflow - tensorflow

I am using Macbook Air with M1 chip. When trying to import tensorflow in Jupyter notebook, the kernel dies and displays a prompt that "Kernel has died and will restart in sometime". Could someone help me fix this?
Tensorflow version - 2.5.0
Python version - 3.8.8

Try running the notebook file within VS Code, there are extensions to help with that. Also check this article on how to install tf on M1 https://towardsdatascience.com/installing-tensorflow-on-the-m1-mac-410bb36b776

It seems this is a recurring issue with multiple people with the m1 macs. Since it is still fairly new, it is possible that Jupiter notebook still doesn't fully support it. Try using anaconda navigator with the windows emulator. Here is a link to a forum post with people having the same problem.
https://github.com/apple/tensorflow_macos/issues/45
Anaconda and upgrading to new M1 Mac

Related

Are there problems with Tensorflow and Keras in Mac version 12.2 (OS Monterey)

I bought a new Mac version 12.2 (OS Monterey) and installed Anaconda. Most of the Python packages can be installed correctly. However, Tensorflow (ver 2.8.0) and Keras (ver 2.8.0) have major issues. The Jupyter notebook kernel gets killed when tensorflow and/or keras get imported. I looked up various posts on Stackoverflow and Medium, however, nothing seems helpful. I even tried to convert the .ipynb to .py script, however, the same error occurs.
Is there anything that can be done to resolve this?

How to debug Kmeans clusters on python 3.9 tensorflow on Mac M1 pro?

When you installed python 3.9 tensorflow on new Mac M1 chip, you would probably come to this bug when you run Kmeans.predict():
nonetype' object has no attribute 'split'
I have searched online for a long time but cannot find any useful solution. So if you happen to have the same issue as mine, maybe you can try this:
Find the file threadpoolctl.py under /Users/YOURNAME/miniforge3/envs/tensorflow/lib/python3.9/site-packages
Replace it by the file in this website:
https://github.com/joblib/threadpoolctl/blob/master/threadpoolctl.py
Restart your python
Hope it helps.
+100500 to the karma: worked for me as well within Python 3.8. The version of threadpoolctl.py was "2.1.0" - after making an update by version "3.2.0.dev0" KMeans started to work.

simply importing tensorflow kills my Jupiter notebook kernel

As described in jypyter notebook I tried:
import tensorflow
then my kernel is killed, like "The kernel appears to have died. It will restart automatically."
Tried to reinstall anaconda, numpy, tensorflow, didn't work.
well I also experienced this normally this can't work because tensorflow is too big for jupyter notebook though you may try downloading the anaconda navigator if you don't have it already though this may not work

Troubles installing Pandas on Mac Book Pro with M1 procesor

I switched from Windows NTB to MacBook Pro with M1. And I am not able to install Pandas, some issue with missing wheel for numpy. I am using Python 3.9. I went through various solutions presented here like this one below, but none work for me: https://stackoverflow.com/a/66048187/16324084
This one was one of the most explanatory, but I went through all steps, but when I run some code I will get this error message:
ModuleNotFoundError: No module named 'pandas'.
As I am new with Apple, no idea what is conda or roseta, so please can somebody write me what I should do to get Pandas installed and working? And please try to explain it as a small child, thanks.
I recommend you install Anaconda, a package manager. Instructions here. I have all of my packaged managed through this on my Big Sur m1 silicone MacBook pro and have not had issues since switching over from Intel.
Once you have installed anaconda, open terminal and run:
conda install pandas
More info on using anaconda here

haveing problem getting importing tensroflow in jupyter and sypder from anaconda installation

To start out I had a anaconda installation with python 3.5.2. After doing a pip tensorflow installation I got an error something like "nosetest...". I searched stackoverflow and got a suggestion to move to python 3.6.
So I uninstalled the whole of anaconda and python. Then did complete fresh install of anaconda with python 3.6.10. Did a pip install of tensforflow. launched spyder and jupyter and could not import tensorflow. However, when I issue commands from python command prompt things work fine.
So can't seem to get tensorflow to import in spypder or jupyter.
Lastly following another suggest I ran the c:/from/my/anaconda/Scripts/activate base. But that also didn't work in spyder. However in jupyter it seemed to import but then crashed on tf.version
with access violation.
Can you please help, I've tried many things and suggestions, can't seem to get tensorflow to work with python 3.5 or 3.6.
Thanks.
P.S. I remember using python3.5.2 sometime ago with the then tensorflow, I think version 1.1x and everything went smoothly, everything installed and imported worked beautifully.