I've been trying to install Tensorflow 2.0 in Anaconda.
So far, tensorflow works fine (i can use the library in my code), but when i'm installing it, it says "installing version: 2.0", then i get version 1.15 instead.
The whole package results updatable (since versione 2.0 does exist and should be available), but even if i try to update it, i keep getting 1.15, which gets back to updatable, and i get back into the loop.
I tried both from the Anaconda Navigator interface and the prompt using conda update tensorflow
, without any success.
Here's there is the link package: tensorflow 2.0 Anaconda
How can i solve the problem?
EDIT :
I successfully installed TensorFlow 2.0 using conda install -c anaconda tensorflow
. Then i got back into Anaconda Navigator and i tried to install Keras 2.2.4.
Looking at the installed packages, seems that installing Keras overwrites the version 2.0 of TensorFlow with the 1.15, am i wrong? Is this a bug?
Here's the image:
Python 3.7–3.10. Ubuntu 16.04 or later. Windows 7 or later (with C++ redistributable)
Go to Anaconda Navigator (make sure you have the latest update), click on 'Environments' and select 'not installed' from the dropdown menu. In the search field type "tensorflow". Click the checkbox for 'tensorflow' but NOT also for 'keras'. Click 'apply' and it will install 2.0, as well as keras. Then all you have to do to use them is:
Now, your Conda’s environment is ready to use. Let’s install TensorFlow 2.0. When you are in the yolov3_tf2 environment, now you can install any package you want. To install TensorFlow 2.0, type this command and hit Enter. Verify the Cuda toolkit and cudnn that will be installed, it must come with Cudatoolkit 10 and cudnn 7.6.
Open Anaconda prompt, and create a new environment called yolov3_tf2 (I gave this name because it relates to my next article about the implementation of YOLOv3 in TensorFlow 2.0). You can name it whatever you want. Just type or copy the following command to your Anaconda prompt and hit Enter.
The whole package results updatable (since versione 2.0 does exist and should be available), but even if i try to update it, i keep getting 1.15, which gets back to updatable, and i get back into the loop. I tried both from the Anaconda Navigator interface and the prompt using conda update tensorflow, without any success.
Another alternative is to install Tensorflow
with Miniconda
.
I simply have used Miniconda3
for windows and I was able to install multiple versions of Tensorflow
on different environment respectively.
Example 1
// create a new environment
conda create --name workflowone
// activate environment
conda activate workflowone
// Install desired package
conda install tensorflow=1.15
// deactivate environment
conda deactivate
Example 2
// create a new environment
conda create --name workflowtwo
// activate environment
conda activate workflowtwo
// Install desired package
conda install tensorflow // If you do not specify the version, you will download the latest version of Tensorflow
// deactivate environment
conda deactivate
conda install -c anaconda tensorflow-gpu
or
conda install -c anaconda tensorflow
Look for these:
Tip: completely shred any file w/ name substring "keras" and "tensorflow" in your Anaconda environment before installing - else stuff is likely to break.
site-packages
**keras**
--> delete all results**tensorflow**
--> delete all resultsAbove should work even better from the environment's root folder (e.g. envs/tf2_env
) -- the idea is, Anaconda caches whatever it's already installed, so if it isn't completely removed, you may find trouble getting latest vers of packages.
Related Q's answered in comments:
Why is conda reverting TF 2 to TF 1.15.0 when I try installing Keras 2.2.4?
Why are some from keras
imports no longer working and need from tensorflow.keras
?
from keras
is very different from from tensorflow.keras
, implementation-wise. from keras
is backend-neutral, whereas tf.keras
is more tightly integrated w/ TF. There can also be significant performance differences. TF2 and onward, tf.keras
is preferable, and development will proceed along it, as noted by F. Chollet
tf.python.keras
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With