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.