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

Viewed 522

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:

  1. Find the file threadpoolctl.py under /Users/YOURNAME/miniforge3/envs/tensorflow/lib/python3.9/site-packages

  2. Replace it by the file in this website: https://github.com/joblib/threadpoolctl/blob/master/threadpoolctl.py

  3. Restart your python

Hope it helps.

1 Answers

+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.

Related