How to install Tensorflow on Intel Xeon Processor based PC? - python

Not really a coding related question.
I am trying to install tensorflow on Intel Xeon(R) CPU E5620 which has Ubuntu 19.10. I can't install it with pip( could someone please explain why). It does gets installed using pip but it just says,
illegal instruction (core dumped)
I have tried building it from the source, but that was a pretty painful process, takes way too much time.
My question is, is their any easier way to install tensorflow on my PC?

Try using conda environment. I have no problem installing and using tensorflow on my machine. I am using tensorflow 1.15 btw and as far as I recall I installed it using pip install tensorflow-gpu==1.15
Cpu model: Intel(R) Xeon(R) CPU E5-2620 v4 # 2.10GHz
OS: Ubuntu 18.04
conda environment python version: 3.5.6

For Intel Z600
Processor: Xeon(R) CPU E5620
OS : Ubuntu 19.10
GPU : GTX 1050
CUDA : 10.0
cuDNN : 7.4
NCCL : 2.6
with the above configuration I successfully build tensorflow 1.14 from source, NO their is no other way to get tensorflow/tensorflow-gpu on this particular PC. I have experienced this that pip and conda don't work when installing tensorflow and that building from source or using docker as mentioned on tf official documentation is the best possible way as for 15 May 2020.
I figured that someone in near future might want to build tensorflow from source on a xeon based CPU, so I wrote how I did it step by step here, https://github.com/kazzastic/Tensorflow-BuildFromSource

Related

how to find suitable version of tensorflow for my machine

inux version 5.15.0-58-generic (buildd#lcy02-amd64-101) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38)
conda version == 22.9.0
pip version == 22.2.2
python version 3.5 and 3.9
I have a machine with intel pentium g2020 cpu and it seems like it does not support AVX instructions. I am currently working on a project and need tensorflow (keras to be more precise) on my machine but any version that I install throws an error. I would need you help to find the suitable version for my machine and the a way to install it.
I tried different python version and tensorflow version but all of them throw errors like kernel died or your machine does not support AVX instructions.

ERROR: tensorflow_cpu-2.11.0-cp310-cp310-win_amd64.whl is not a supported wheel on this platform

I'm trying to install tensorflow,
at beginning I thought the error was caused by python 3.11
I changed the interpreter to python 3.10 but I still have the same problem.
I can't install tensorflow and the error is
ERROR: tensorflow_cpu-2.11.0-cp310-cp310-win_amd64.whl -
is not a supported wheel on this platform.'''
intel laptop running on win 11, amd ryzen 5000 series, amd radeon graphics
thanks
screen vscode
The API you are using basically a single version of tensorflow 2.11.0. Developers designed different wheels for differnt OS requiremnts. As as the latest version of tensorflow is 2.11.0 so don't wory installing through Above API. Install directly using PIP. Let PIP decide supported version.
pip install tensorflow

Optimal installation of tensorflow with M1 Mac native Anaconda 2022.05

Now that Anaconda is natively supporting M1 Macs with their 2022.05 release, I was wondering what the best way to install tensorflow on these machines is.
https://www.anaconda.com/blog/new-release-anaconda-distribution-now-supporting-m1
conda create -n anaconda_mac_2 tensorflow
as suggested on https://docs.anaconda.com/anaconda/user-guide/tasks/tensorflow/ fails on my machine.
I can successfully install a working version of tensorflow with conda-forge like so
conda install conda-forge::tensorflow
however this is not utilsing the GPUs as with previous versions of anaconda:
import tensorflow as tf
gpu = len(tf.config.list_physical_devices('GPU'))>0
print("GPU is", "available" if gpu else "Not Available")
GPU is Not Available
is it still best to make use of the M1 GPU architecture with the tensorflow-metal releases and run a separate version through miniforge that supports aarch64?
Would be grateful if anyone has already some experience or even done some testing, Cheers.

How to get tensorflow keras to use my GPU?

I am trying to use keras in tensorflow to train a CNN network for some image classification. Obviously, the training running on my CPU is incredibly slow and so I need to use my GPU to do the training. I've found many similar questions on StackOverflow, none of which have helped me get the GPU to work, hence I am asking this question separately.
I've got an NVIDIA GeForce GTX 1060 3GB and the 466.47 NVIDIA driver installed. I've installed the CUDA toolkit from the NVIDIA website (installation is confirmed with nvcc -V command outputting my version 11.3), and downloaded the CUDNN library. I unzipped the CUDNN file and copied the files to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3, as stated on the NVIDIA website. Finally, I've checked that it's on PATH (C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin and C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\libnvvp are both in the environment variable 'Path').
I then set up an environment using conda, downloading some packages that I need, like scikit-learn, as well as tensorflow-gpu=2.3 After booting my environment into Jupyter Notebook, I run this code to check to see if it's picking up the GPU:
import tensorflow as tf
print(tf.__version__)
print(tf.config.list_physical_devices())
And get this:
2.3.0
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
I have tried literally everything I have come into contact with on this topic, but am not getting any success in getting it to work. Any help would be appreciated.
You, first, have to install all CUDA requirements. If you have Ubuntu 20.04, here is how you can install the requirements. Then it's the right time to install tensorflow. Asa you intended to utilize your GPU, you have install tensorflow-gpu library, not tensorflow alone.
I'm guessing you have installed TensorFlow correctly using pip install tensorflow.
NVIDIA GPU cards with CUDA architectures 3.5, 5.0, 6.0, 7.0, 7.5, 8.0 and higher than 8.0 are currently supported by TensorFlow. If you have the supported cards but TensorFlow cannot detect your GPU, you have to install the following software:
NVIDIA GPU drivers —CUDA 11.0 requires 450.x or higher.
CUDA Toolkit —TensorFlow supports CUDA 11 (TensorFlow >= 2.4.0)
cuDNN SDK 8.0.4
You can optionally install TensorRT 6.0 to improve latency and throughput for inference on some models.
For more info, please refer to the TensorFlow documentation: https://www.tensorflow.org/install/gpu
I recommend to use conda to install the CUDA Toolkit packages as well as CUDNN, which will avoid wasting time downloading the right packages (or making changes in the system folders)
conda install -c conda-forge cudatoolkit=11.0 cudnn=8.1
Then you can install keras and tensorflow-gpu by typing
conda install keras==2.7
pip install tensorflow-gpu==2.7
and it will work directly.
Based on this issue

TensorFlow GPU doesn't work, How to install it?

I started learning about the tensorflow recently and decided to switch to the GPU version, because it is much faster, but I can not import it, it always gives the same error.
I already tried:
Installing it by pip, in python 3.6.8, cuda 10 and the most recent cuDNN for cuda 10
I tried reinstalling python, CUDA and cuDNN
Tried installing Visual Studio and installed CUDA 9 and cuDnn
I tried installing the latest Anaconda, created a "default" env and another in python 3.6 (also tried in 3.5), pip install tensorflow-gpu in both cases
my last attempt was to follow a tutorial on youtube, I did exactly as demonstrated (https://www.youtube.com/watch?v=KZFn0dvPZUQ)
Everything i tried returned the same error.
Traceback: https://pastebin.com/KMEsZAmq
The complete code: https://pastebin.com/7tS0Rd5S (was working on CPU version)
.
My Specs:
i5-8400
8 GB Ram
GTX 1060 6GB
W10 home x64
just have a look here:
https://www.tensorflow.org/install/gpu
Tensorflow supports CUDA 9.0, you will need to downgrade your CUDA or use one of the tensorflow's docker images:
https://www.tensorflow.org/install/docker
via docker it won't use your CUDA drivers

Categories