Anaconda tensorflow packages incomplete? (just few kilobytes filesize) - python

I am following the instruction at https://anaconda.org/anaconda/tensorflow-gpu to install "tensorflow-gpu" (currently 1.12.0 for linux64) by running
conda install -c anaconda tensorflow-gpu
in the currently active conda environment. At first this seems to work fine as in python3, I can import tensorflow as tf, but then I cannot even access e.g. tf.__version__ since it is undefined.
I then found out at https://anaconda.org/anaconda/tensorflow-gpu/files that all the recent tensorflow-gpu*.tar.bz2 packages are just a few kilobytes in size. Similarly, all non-gpu packages at https://anaconda.org/anaconda/tensorflow/files also are just around 4kb in size. This seems odd as tensorflow should easily require few hundreds of megabytes. So my question is, what is the point of these few kilobytes conda packages, and what am I doing (and understanding) wrong if I want to install tensorflow in an anaconda environment.

Faced the same issue. You can get tensorflow working by installing it using pip instead of conda using:
pip install --upgrade tensorflow

Related

Environmental Error occurs while installing Tensorflow

When installing Tensorflow it said I was missing a file but i dont know how to fix it and or get that file
I have tried re-downloading python but I am still missing the file
pip install Tensorflow
What I want is for the installation to complete.
Here is the error message:
C:\Users\MYUSER\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow_estimator\python\estimator\canned\linear_optimizer\python\utils\__pycache__\sharded_mutable_dense_hashtable.cpython-37.pyc'
This is a typical Windows problem with long file paths. Disable the MAX_PATH limitation; the instruction for that can e.g. be found here:
3.1.2. Removing the MAX_PATH Limitation
Windows historically has limited path lengths to 260 characters. This meant that paths longer than this would not resolve and errors would result.
In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem#LongPathsEnabled to 1.
After that, reboot and retry the installation.
When installing Tensorflow it said I was missing a file but i don't know how to fix it and or get that file.
Create a environment using anaconda.
This Problem can be solved by execute the Below commands:
conda update anaconda
conda create -n tensorflow pip python=3.5
conda install --force html5lib
activate tensorflow
pip install --ignore-installed --upgrade tensorflow
conda install -c conda-forge tensorflow
conda install jupyter
Refer this https://www.tensorflow.org/tutorials
Finally you can able to install Tensorflow.
I hope it will help you.

AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'

I am trying to develop some time-series sequence prediction, using the latest resources available. To that end, I did check the example code from TensorFlow time-series, but I'm getting this error:
AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'
I'm using Anaconda. The current environment is Python 3.5 and TensorFlow 1.2.1. Also tried TensorFlow 1.3, but nothing changed.
Here is the code I'm trying to run. I did not find anything useful related to the issue on Google. Any ideas on how to solve it?
As Conan.Net wrote:
I tried to remove/clean some environments from anaconda and install
all again and it work this time.
This solution worked for me as well, so though not ideal, it will solve the problem. If you are using anaconda, it might happen when installing some packages and then removing them (e.g. tensorflow vs tensorflow-gpu) leaves some dependencies hanging. In my case, I used:
conda remove --name py2_tf_gpu --all
then
conda create --name py2_tf_gpu python=2 anaconda pandas numpy scipy jupyter
source activate py2_tf_gpu
pip install --ignore-installed --upgrade tensorflow-gpu
pip currently installs a later(1.4) than anaconda(1.3) version and I had need for it.
Maybe the version of tensorflow doesn't match the version of keras.
Using a lower version of keras solve this problem

Switching from tensorflow on python 3.6 to python 3.5

This is my first question on stackoverflow, please bear with me as I will do my best to provide as much info as possible.
I have a windows 10, 6-bit processor. My end goal is to use keras within spyder. The first thing I did was update python to 3.6 and install tensorflow, which seemed to work. When I attempted to get keras, however, it wasn't working, and I read that keras worked on python 3.5. I successfully installed keras on python 3.5, which automatically installed theano as the backend.
But now I have two spyder environments, one running off of python 3.5, one off of 3.6. The 3.5 reads keras but doesn't go through with any modules because it cannot find tensorflow. The 3.6 can read tensorflow, but cannot find keras.
Please let me know what you would recommend. Thank you!
Create a virtualenv with python 3.5 installed.
I dealt with this same issue, using Jupyter Notebook. Didn't understand why you would even need a virtualenv until I learned from this roadblock.
Full details on installing and setting up a virtualenv can be found here:
http://pymote.readthedocs.io/en/latest/install/windows_virtualenv.html
Odd, the installation instructions say that TF only supports Python 3.5 on Windows. I would uninstall TF with pip uninstall tensorflow (if you installed it with pip to begin with) using pip from your Python 3.6 path, then re-install (pip install --upgrade tensorflow) making sure that you are running pip from your Python 3.5 path.
I had some issues with my tensorflow's installation too.
I personnaly used anaconda to solve the problem.
After installing anaconda (Maybe uninstall the old one if you already have one), launch an anaconda prompt and input conda create -n tensorflow python=3.5, afther that, you must activate it with activate tensorflow.
Once it's done, you have to install tensorflow on your python 3.5.
For that, use:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.0rc1-cp35-cp35m-win_amd64.whl
for cpu version
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.2.0rc1-cp35-cp35m-win_amd64.whl for gpu version
You now have the r1.2 version of tensorflow.
Then, just use pip install keras and keras will be installed.
Now, all you have to do is launch anaconda navigator, select tensorflow on the scrolling menu and launch spyder/jupyter.
You can now use Keras with a tensorflow backend in Python 3.5
Hope it helped someone ! (It take me so much time to find it by myself)

pip: need to change name of package tensorflow-gpu to tensorflow

I'm trying to install tensorflow with gpu support into a conda environment
I use the command:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-linux_x86_64.whl
When I look at the packages installed with conda list I wind up with a package called tensorflow-gpu.
You cannot even import this package because it has a '-' in it.
How can I change the name to 'tensorflow'?
Edit: I'm now thinking that there must be something more to this. Why would a major package in the deep learning community have this apparent problem. Hopefully, a tensorflow expert can answer. I'm following the directions for Ubuntu and Anaconda here: https://www.tensorflow.org/install/install_linux
When you install the tensorflow gpu version, Anaconda will show that you have installed tensorflow-gpu. The -gpu just indicates that it is a gpu version and is not a part of the name. You can still just import tensorflow and the gpu version will be found.
I had a similar problem which was quite frustrating. I started with recently built .whl file and tried to install.
pip install /home/ubuntu/xfer/tensorflow_gpu-1.2.1-cp27-none-linux_x86_64.whl
Command line testing:
pip show tensorflow
no package called tensorflow
pip show tensorflow-gpu
but there is a package tensorflow-gpu at version 1.2.1
However, running one line in python failed despite assurances that conda would substitute:
import tensorflow as tf
I then repeated the pip install of the .whl file with the --upgrade option:
pip install --upgrade /home/ubuntu/xfer/tensorflow_gpu-1.2.1-cp27-none-linux_x86_64.whl
And then the one line of python succeeded:
import tensorflow as tf
And in fact based on https://www.tensorflow.org/install/install_linux#run_a_short_tensorflow_program, one would then run a slightly longer program which also succeeds:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

How do you install Tensorflow on Windows?

I am trying to install Tensorflow on Windows.
I have Anaconda 4.2.0. I tried running
conda create -n tensorflow python=3.5
in my command prompt. This seemed to do something, but I'm not sure what this accomplished. It created a folder within the Anaconda3 program in my username folder.
This folder is filled with the following content:
Over the summer, I used mainly Jupyter Notebooks to do my python coding. Within this environment, there is a tab marked Condas
So it looks like I should be able to switch to the Tensorflow environment. But this doesn't work when I try to switch, there is no option to change my kernel to a Tensorflow one.
I tried running
conda search tensorflow
But nothing appears.
I'm not sure what to do. I asked a few grad students in my economics research group, but they weren't sure what to do either.
My Question
How do I properly install Tensorflow on Windows?
The syntax of the command is conda create -n <name_of_new_env> <packages>. As a result, you created a clean environment named tensorflow with only Python 3.5 installed. Since conda search tensorflow returned nothing, you will have to use pip or some other method of installing the package. Since there is spotty official support for Windows, the conda-forge package (CPU only) at https://github.com/conda-forge/tensorflow-feedstock is probably the best way.
People have also reported success installing Tensorflow with docker, if you have docker set up already.
I was able to run it under the Windows 10 linux subsystem (https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
Which is basically a linux environment within windows.
The latest tensorflow version (0.12) added windows support
https://www.tensorflow.org/get_started/os_setup#pip_installation_on_windows
just run:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl
(the url is for the specific version - you will need to change it for future versions or other setups)
An Anaconda environment isolates itself completely with the outer world, so all the packages you installed outside the virtualenv is nothing in the virtualenv, if you want to use Tensorflow in the environment(seems like the only way with Anaconda), use activate tensorflow command and install the packages you want seperately.
pip provides an easy method to install tensorflow on windows machine.
use the following pip command
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
Tensorflow only support python3.5 x64 bit on windows machines and it requires that you install Visual C++ 2015 redistributable (x64 version) to be able to import tensorflow

Categories

Resources