tensorflow not supported wheel on this platform - tensorflow

I've searched around and non of the solutions seem to pertain to me, so here I am.
I installed anaconda 5.1 for python 3.6, I downloaded and installed 64-Bit(x86)Installer(551 MB)
from
https://www.anaconda.com/download/#linux
I followed the directions here
https://docs.anaconda.com/anaconda/install/linux
I had the install prepend the path and install microsoft VS code.
I then attempt to install the CPU only tensorflow using anaconda as suggested here
https://www.tensorflow.org/install/install_linux#InstallingAnaconda
I try to install the binary for python 3.6 CPU only
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp36-cp36m-linux_x86_64.whl
I get the following error
tensorflow-1.6.0-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.
I am running a Ubuntu 16.04 VM on windows 10.
edit: when I run this command
pip install --ignore-installed --upgrade tfBinaryURL
outside of the tensorflow environment it worked.
2nd edit:
Additionally I explored my tensorflow environment in my anaconda3 folder, and I noticed it only has python 2.7, so when I tried to install the cpu only tensorflow while in the enviroment for python 2.7 it worked.

Related

Installing tensorflow 1.9 on raspberry pi*addressed by modifying code to work with tf 2

updated code to work with tensorflow 2.4 to get around issue
I'm trying to install Tensorflow 1.9 on a Raspberry Pi as it is a requirement of the code I want to run. It installs fine on my Macbook using pip install tensorflow==1.9.0, but on the Pi I get the error:
Could not find a version that satisfies the requirement tensorflow==1.9.0 (from versions: 0.11.0, 1.11.0, 1.12.0, 1.13.1, 1.14.0)
No matching distribution found for tensorflow==1.9.0
I'm using a Conda (miniconda3) environment with Python 3.6.
Would using Ubuntu Desktop instead of Raspberry Pi OS work maybe? Or is there perhaps a way to build it from https://github.com/tensorflow/tensorflow/tree/r1.9?
You need to install python version 3.6 or other compatible versions in conda. Tensorflow does not work on versions higher than 3.8 and has identified issues with some other versions. I recommend using python 3.6 through conda. You will also probably need to move the
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
files from anaconda3\Library\bin to anaconda3/DLLs. You can find more details about this issue if you run into it here.
Hope this answers your question!
To install Tensorflow on Raspberry Pi run:
sudo apt install libatlas-base-dev
and then
pip3 install tensorflow
You can also compilte TensorflowLite and use if you wish. The compile TensorflowLite on RPi refer this link

Can't install tensorflow on python 3.9

When I try to install tensorflow on python 3.9 I get following error:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
Is not there any tensorflow for 3.9?
What do you guys recommend?
Can I install other version of python beside the existing version?
Right now tensorflow does not have a build for python3.9
The latest one is for python3.8
You can check the build files at PyPI
https://pypi.org/project/tensorflow/#files
yes, you can install another version of python.
The original poster did not mention what type of computer or operating system he was using while attempting to install TensorFlow alongside Python 3.9. The error could be linked to working on a 64-bit Mac with the M1 chip (I recently experienced the same error described above while working on a Mac M1 in a Miniconda environment with Python 3.9.13). I solved the error by running
python3 -m pip install tensorflow-macos
from Terminal (in the Miniconda environment). TensorFlow installed normally alongside Python 3.9.13.
I do recommend installing Miniconda (or Anaconda as others have suggested), because it will allow you to easily create development environments with whatever version of Python modules or dependencies you require at the moment. See https://docs.conda.io/en/latest/miniconda.html. The larger Anaconda comes with a user-friendly 'Navigator' GUI which enables you to choose which environment is used to open a Jupyter notebook or other development environment, several of which come with Anaconda. See https://docs.anaconda.com/anaconda/install/
This is terrible with newer versions of Python that are not compatible with the machine learning module package.
So my approach is to keep the existing version 3.9 and the computer is using Anaconda to install a virtual environment with 3.7. When using vscode or pycharm, just remember to set it to that 3.7 Python environment.

Tensorflow will not run on GPU

I'm a newbie when it comes to AWS and Tensorflow and I've been learning about CNNs over the last week via Udacity's Machine Learning course.
Now I've a need to use an AWS instance of a GPU. I launched a p2.xlarge instance of Deep Learning AMI with Source Code (CUDA 8, Ubuntu) (that's what they recommended)
But now, it seems that tensorflow is not using the GPU at all. It's still training using the CPU. I did some searching and I found some answers to this problem and none of them seemed to work.
When I run the Jupyter notebook, it still uses the CPU
What do I do to get it to run on the GPU and not the CPU?
The problem of tensorflow not detecting GPU can possibly be due to one of the following reasons.
Only the tensorflow CPU version is installed in the system.
Both tensorflow CPU and GPU versions are installed in the system, but the Python environment is preferring CPU version over GPU version.
Before proceeding to solve the issue, we assume that the installed environment is an AWS Deep Learning AMI having CUDA 8.0 and tensorflow version 1.4.1 installed. This assumption is derived from the discussion in comments.
To solve the problem, we proceed as follows:
Check the installed version of tensorflow by executing the following command from the OS terminal.
pip freeze | grep tensorflow
If only the CPU version is installed, then remove it and install the GPU version by executing the following commands.
pip uninstall tensorflow
pip install tensorflow-gpu==1.4.1
If both CPU and GPU versions are installed, then remove both of them, and install the GPU version only.
pip uninstall tensorflow
pip uninstall tensorflow-gpu
pip install tensorflow-gpu==1.4.1
At this point, if all the dependencies of tensorflow are installed correctly, tensorflow GPU version should work fine. A common error at this stage (as encountered by OP) is the missing cuDNN library which can result in following error while importing tensorflow into a python module
ImportError: libcudnn.so.6: cannot open shared object file: No such
file or directory
It can be fixed by installing the correct version of NVIDIA's cuDNN library. Tensorflow version 1.4.1 depends upon cuDNN version 6.0 and CUDA 8, so we download the corresponding version from cuDNN archive page (Download Link). We have to login to the NVIDIA developer account to be able to download the file, therefore it is not possible to download it using command line tools such as wget or curl. A possible solution is to download the file on host system and use scp to copy it onto AWS.
Once copied to AWS, extract the file using the following command:
tar -xzvf cudnn-8.0-linux-x64-v6.0.tgz
The extracted directory should have structure similar to the CUDA toolkit installation directory. Assuming that CUDA toolkit is installed in the directory /usr/local/cuda, we can install cuDNN by copying the files from the downloaded archive into corresponding folders of CUDA Toolkit installation directory followed by linker update command ldconfig as follows:
cp cuda/include/* /usr/local/cuda/include
cp cuda/lib64/* /usr/local/cuda/lib64
ldconfig
After this, we should be able to import tensorflow GPU version into our python modules.
A few considerations:
If we are using Python3, pip should be replaced with pip3.
Depending upon user privileges, the commands pip, cp and ldconfig may require to be run as sudo.

Installing tensorflow-gpu 1.3.0 on windows 10

I have been trying to install tensorflow-gpu on windows 10, via
pip3 install --upgrade tensorflow-gpu
When I do this I break the current installation of ordinary tensorflow!, and get this error: On Windows, running "import tensorflow" generates No module named "_pywrap_tensorflow" error.
Somehow I manage to fix this by re-installing ordinary tensorflow, but then when I import tensorflow in python 3.5.2 and try to identify my GPU, No device is found!
I have a Cuda 9.0 installed alongside cudnn64_6 defined as a DLL in CUDA/v9.0/bin, and I can run the nbody test program without problems and I can see the GPU being used for that demo application.
Is there any known issue with tensorflow-gpu 1.3.0?
Really struggling on this. Why does it have to be so problematic installing this library!
Please help
mg
TensorFlow 1.3 (and 1.4) require CUDA 8.0 and do not support later versions. You will either need to downgrade CUDA to 8.0 or make a custom build from source.

TensorFlow on Windows: "not a supported wheel on this platform" error

Was happy to know Tensorflow is made available for Windows and we don't have to use Docker.
I tried to install as per instructions but I get this error.
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
What does that error mean?
I am running latest version of Python.
python --version
Python 3.5.2
This is most likely to be a 64-bit versus 32-bit issue. The pre-built TensorFlow pip package is 64-bit only, but the default version of Python 3.5.2 on Python.org is 32-bit. You can download the 64-bit release from here (select one of the "Windows x86-64" options).
It's only available for Python 3.5.x not 3.6.
You can quickly create a 3.5 environment with:
conda create -n tensorflow python=3.5
You must have a 3.5.x version of Python. The 3.6 version won't work.
If you have installed an Anaconda that contains Python 3.6, you need to downgrade its Python to 3.5.2.
Open the Anaconda Prompt as administrator, and run:
conda install python=3.5.2
After the installation is finished, you can follow the rest of the steps on tensorflow website.
Do you have Python and Anaconda installed? I had a similar issue until I uninstalled Anaconda and then the setup was fine.
I did the following steps and it worked.(Anaconda 4.4 x64)
1- Go to Windows 10 command prompt (right click and Run as admin)
2- if activated the path, you can run conda anywhere, if not, should go to .../anaconda3/scripts and run conda command from there and do the following (the main trick was to change 35 to 36)
1- conda -n tensorflow python=3.5
2- activate tensorflow
3- pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp36-cp36m-win_amd64.whl
issues fixed when i did the downgrading from 3.6 to 3.5 using the below
conda install python=3.5.2
There can be two reasons:
1) You are using 32-Bit python package. Tensorflow does not support 32 bit, only 64 fit.
Check in your system settings for this. If this is fine refer to second point..
2)You are using Python 3.7.
Python 3.7 isn't eventually officially supported by Python. It's still in beta testing,
and very much under active development.
Consider downgrading to a lower version of python. For now, stick with Python 3.6 or 3.5.