1

I recently found an article that indicates that the conventional methods for downloading python machine learning modules such as tensorflow and keras are not optimized for computers with a cpu. How can I configure tensorflow and keras to make it most compatible with my processor on MacOSX in python 2.7?

If it helps, I use pycharm to download most of my libraries and for my coding interface.

Jonathan
  • 303
  • 4
  • 14
  • I don't think the installing pathway is different. Did you have a look into configuring e.g. tensorflow for CPU only usage? https://stackoverflow.com/questions/37660312/how-to-run-tensorflow-on-cpu – Dschoni Jun 25 '18 at 15:28
  • Tensorflow doesn't support Python 2.7. Check this answer - https://stackoverflow.com/a/50044950/8010361 – dedsec Jun 25 '18 at 15:31
  • @AzizulHaqAnanto according to the docs, it does: https://www.tensorflow.org/install/install_mac . The answer you linked is for windows. – Dschoni Jun 25 '18 at 15:34

2 Answers2

1

For any environment if you want to install tensorflow, you can simply run this command :

pip install tensorflow (for CPU, python2.7)
pip3 install tensorflow (for CPU, python3)

You need to mention externally if you want to install tensorflow with GPU like this:-

pip install --upgrade tensorflow-gpu

but for GPU you will need CUDA (NVDIA graphics) to run.

and very same way, you can install keras Where you dont have to pass keras-gpu externally while using command:-

 pip install keras
Naitik Chandak
  • 110
  • 1
  • 3
  • 14
0

I think what you read meant that tensorflow programs work much faster if your computer has a GPU. You need a Nvidia GPU in your computer to install tensorflow with GPU support on your Mac and as far as I know, after version 1.2 tensorflow no longer provides GPU support for MacOS

  • This is not what I'm talking about. I know that a GPU is much faster and I would get one if I could afford it. I found the article: https://medium.com/@andriylazorenko/tensorflow-performance-test-cpu-vs-gpu-79fcd39170c – Jonathan Jun 25 '18 at 15:39
  • Notice the second test where after reconfiguring the download he got much better results. – Jonathan Jun 25 '18 at 15:41
  • That article says to building tensorflow from source will give faster performance. Did you try the method give in the article? – Krishna Wadhwani Jun 25 '18 at 16:43