I am currently using tensorflow 1.2.1 and I am trying to update to version 1.7.0 using conda, but it is downgraded to 1.1.0. Why is this happening?
The default tensorflow version under conda package manager is 1.1.0.
Try creating a new environment within Anaconda with conda virtual environment manager (refer to this doc for more information):
$ conda create -n tensorflow
So the subsequent tensorflow installation won't mess up with your default Anaconda environment (I personally experienced this).
After successfully creating the virtual environment, activate it by:
$ source activate tensorflow
Your prompt should then change to:
(tensorflow) $
To install tensorflow version 1.7.0 in the new prompt, use pip instead of conda:
(tensorflow) $ pip install --ignore-installed --upgrade TF_PYTHON_URL
where TF_PYTHON_URL is the url of the tensorflow package with the latest version 1.7.0 (choose according to your python version).
Note that packages (e.g., spyder) you want to use together with tensorflow which are not already in the new environment should be installed:
(tensorflow) $ conda install spyder
This step can be merged with Step 1 by issuing a single command in the default prompt:
$ conda create -n tensorflow spyder
Every time you work with tensorflow, activate the (tensorflow) environment using Step 2, and after you finish, deactivate the environment to revert back to the default prompt:
(tensorflow) $ source deactivate
Hope these can help :-)
Related
I am using yolov4 tiny on raspberry pi4 with 2GB module.
I install the almost all packages and activate the environment.install tensor-flow and tft-lite but when i execute the detection.py code i get the error.
Value Error: Didn't find op for builtin opcode 'RESIZE_BILINEAR' version '3' Registration failed.
i am using the code of "theAIGuysCode" ...
repo link = https://github.com/theAIGuysCode/yolov4-custom-functions
Problem is mismatch of converter version and runtime version. Make sure you use recommended setup (tf 2.3.0):
Conda (Recommended)
Tensorflow CPU conda env create -f conda-cpu.yml conda activate yolov4-cpu
Tensorflow GPU conda env create -f conda-gpu.yml conda activate yolov4-gpu
Pip
TensorFlow CPU pip install -r requirements.txt
TensorFlow GPU pip install -r requirements-gpu.txt
Check installed version (call print(tf.version) or check requirements.txt ) and install same version for your RPi.
I have Anaconda under Windows 8.1, Python 3.7 e TensorFlow 1.14. I tried some pip commands but the 1.14 is the only version installed of TensorFlow.
There are other ways to update, for example, version 1.5 ?
Thank a lot for any help!
Tensorflow 1.14 is the latest release for the time being. If you wanna install a specific version
conda install tensorflow=1.5.0
The problem is that tensorflow 1.5 is not compatible with Python 3.7 before 1.13.0rc1.
If you need version 1.5.0, you need to create a virtual environment with Python 3.6 using conda.
conda create -n py36 python=3.6
conda activate py36
conda install tensorflow=1.5.0
# you can also install tensorflow using pip
# choose the package manager you want
conda install tensorflow==1.5.0
Note: Don't use pip and conda to install pkg at the same time in one environment. Check Using Pip in a Conda Environment for more info.
I am trying to install Tensorflow and Horovod
pip install tensorflow
HOROVOD_WITH_TENSORFLOW=1 pip install horovod
Then I ran a sample code
import tensorflow as tf
import horovod.tensorflow as hvd
When I run this code, I get the error
ImportError: Extension horovod.tensorflow has not been built. If this is not expected, reinstall Horovod with HOROVOD_WITH_TENSORFLOW=1 to debug the build error.
If you need to install tensorflow and horovod , you can use the following steps:
1)Create a conda environment to avoid the mismatch of package versions.
conda create -n test_hvd -c intel python=3.6
2)Activate the environment
source activate test_hvd
(You can use any name instead of test_hvd, which is an environment name.)
3)Install tensorflow in the activated environment:
pip install https://storage.googleapis.com/intel-optimized-tensorflow/tensorflow-1.10.0-cp36-cp36m-linux_x86_64.whl
4)Finally install horovod
pip install --no-cache-dir horovod
Note: 1. Kindly confirm if you are using the latest versions of GCC (gcc (GCC) 6.4.0 works fine).
These steps are tested on Linux OS
Hope this helps!
I have been using anaconda environment. Now that I have installed tensorflow in my windows through the command prompt and following the necessary steps. I am not able to use tensorflow in anaconda platform. Please help. Thank you.
Create a conda environment named tensorflow by invoking the following command:
C:> conda create -n tensorflow pip python=3.5
Activate the conda environment by issuing the following command:
C:> activate tensorflow
Issue the appropriate command to install TensorFlow inside your conda environment. To install the CPU-only version of TensorFlow, enter the following command:
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command (on a single line):
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow-gpu
You can read further by visiting here
I have been trying to update tensorflow from 1.2.1 to 1.3.
I did the following on my terminal:
pip3 install tensorflow --upgrade
After this, I tried checking the version
python3 -c 'import tensorflow as tf; print(tf.__version__)'
This outputs 1.2.1 but not 1.3.0
All this had been done in an anaconda environment.
Operating system: macOS Sierra
I would like to know how one can perform this update.
Thank you
The solution that I found was to install pip inside the conda environment and use that instance of pip to install the packages. Please refer here
The reason I got the above error was that the python3 and pip3 paths were different.
This became evident when I ran the below commands inside the conda environment.
which python3
/Users/SMBP/anaconda/envs/tensorflow/bin/python3
which pip3
/usr/local/bin/pip3
Also, I think it is better to use virtualenv and virtualenvwrapper if you wish to work with tensorflow as it is the recommended way.