I had initially installed tf-nightly by mistake and later uninstalled it. Now, I have installed two different versions of tensorflow on two different conda environments (tf1.14-gpu and tf2.0-gpu). When I execute the command
conda list -n tf1.14-gpu tensorflow it shows the following output
# Name Version Build Channel
tensorflow 1.14.0 gpu_py36h3fb9ad6_0
tensorflow-base 1.14.0 gpu_py36he45bfe2_0
tensorflow-estimator 1.14.0 py_0
tensorflow-gpu 1.14.0 h0d30ee6_0
When I execute the command conda list -n tf2.0-gpu tensorflow it shows the following output
# Name Version Build Channel
tensorflow 2.1.0 gpu_py36h2e5cdaa_0
tensorflow-base 2.1.0 gpu_py36h6c5654b_0
tensorflow-estimator 2.1.0 pyhd54b08b_0
tensorflow-gpu 2.1.0 h0d30ee6_0
But in both the environments when i import tensorflow and check for its version, it gives the same output as '2.2.0-dev20200218' which I assume is the version for tensorflow nightly build. I am not able to use this version for my existing models. I tried uninstalling anaconda and reinstalling the two environments with tensorflow 1.14 and tensorflow 2.0, but it tensorflow version still shows the same as '2.2.0-dev20200218'. Any idea how to overcome this ?
I ran to the same problem. Could it be possible that you installed tf-nightly using pip and not Conda? But when you run import tensorflow as tf; print(tf.__version__)it picks up the global pip version which is troublesome to get rid of?
p.s. Sorry that I'm posting instead of commenting. Don't have 50 reputation points yet.
Related
Let's start from the beginning.
I went to my Anaconda powershell prompt and typed conda list. I see that Theano-pymc is installed in my base environment, along with pymc3 (and, by the way, pymc and pymc-base, which were installed earlier, I guess); see below:
pymc 5.0.0 hd8ed1ab_1 conda-forge
pymc-base 5.0.0 pyhd8ed1ab_1 conda-forge
pymc3 3.11.2 pyh4f5629e_2 conda-forge
theano-pymc 1.1.2 py39h415ef7b_0 conda-forge
Looks well, because I just need to use pymc3. Now opening a notebook in my Jupyter notebook (version 6.4.12), I just tried to run: import pymc3 as pm and got an error, saying:
"The installed Theano(-PyMC) version (1.0.5) does not match the PyMC3 requirements.
For PyMC3 to work, Theano must be uninstalled and replaced with Theano-PyMC.
See https://github.com/pymc-devs/pymc3/wiki for installation instructions."
The github link is almost void and, moreover, incomprehensible to ordinary mortals…
So, how can I use pymc3 in Python, please? Is there a trick? Only insiders can understand?
Note that in my conda list, I don't have any Theano version (1.0.5) (I have a theano-pymc, version 1.1.2, instead...)
My Python version is '3.9.7'
Running Anaconda and installed:
Keras = 2.4.3
TensorFlow = 2.4.0
However, when importing Keras - I get "Keras requires TensorFlow 2.2 or higher".
Tried uninstalling/installing - did not help.
Any idea?
You can use
pip install --upgrade tensorflow
to install an upgraded and compatible TensorFlow version in your system.
I'm trying to reproduce the results from the Graph-RCNN model here and am running into an error when I try to train it. I know about the error "truth value of an array with more than one element is ambiguous", but I don't know when you can have syntax like that without throwing the error. Is a solution downgrading my version of Numpy? Generally, is there a likely package incompatibility error I should check first? Are there older versions of Numpy or h5py that don't throw this error. I just followed the instructions on the environment setup within the repo and installed everything using Conda. This is all in python 3.6.2 in a Conda environment
Notable package versions:
cython 0.29.23 py36h2531618_0
h5py 2.8.0 py36h3010b51_1003 conda-forge
mkl 2020.4 h726a3e6_304 conda-forge
numpy 1.19.2 py36h54aff64_0
numpy-base 1.19.2 py36hfa32c7d_0
pycocotools 2.0.2 py36h8c4c3a4_1 conda-forge
pytorch 1.0.0 py3.6_cuda9.0.176_cudnn7.4.1_1 pytorch
scipy 1.4.1 py36h2d22cac_3 conda-forge
torchvision 0.2.1 py_2 pytorch
I'm relatively new working with Tensorflow and Keras, and I want to switch the process for my ANN with GPU. I tried some tutorials on YouTube, and it didn't work for me. So, I tried the simplest one that I found, and I attach the link below.
Video tutorial on Youtube
I also changed some of the installed packages in the Anaconda environment because some guides told me that it could be some conflicting versions of cuDNN and CUDA. Here are some installed packages in the environment.
cudatoolkit 10.0.130 0
cudnn 7.6.5 cuda10.0_0
keras-applications 1.0.8 py_0
keras-preprocessing 1.1.0 py_1
tensorflow 1.14.0 gpu_py36h305fd99_0
tensorflow-base 1.14.0 gpu_py36h55fc52a_0
tensorflow-estimator 1.14.0 py_0
tensorflow-gpu 1.14.0 h0d30ee6_0
When I run the command on IPython Console (from Spyder), this message alway appears after I run this command.
In [2]: from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version
Have you updated your GPU driver? See this table for the minimum version.
The easier way to run TensorFlow on your GPU is to use the container from NGC: https://ngc.nvidia.com/catalog/containers/nvidia:tensorflow
I have tensorflow listed as a requirement in the install_requires section of the setup.py of my project.
When I attempt to install my project into a new Anaconda environment I get the following error:
$ python setup.py install
...
Searching for tensorflow
Reading https://pypi.org/simple/tensorflow/
No local packages or working download links found for tensorflow
error: Could not find suitable distribution for Requirement.parse('tensorflow')
I can get past this by installing tensorflow "manually" via conda:
$ conda install tensorflow
Once I do this the install via setup.py works without a hitch.
Am I mistaken in assuming that something is amiss with my environment? If not then what is going on and how can I avoid this issue? (My concern is that users of my package will not be able to install from source using setup.py)
Another oddity that I assume is related or may provide a clue is that the version of TensorFlow listed in my Anaconda environment is 2.0 but if I import it when running Python it appears to instead be using version 1.15. For example:
$ conda list tensorflow
# packages in environment at /home/james/miniconda3/envs/cvdata_test:
#
# Name Version Build Channel
tensorflow 2.0.0 mkl_py37h66b46cc_0
tensorflow-base 2.0.0 mkl_py37h9204916_0
tensorflow-estimator 2.0.0 pyh2649769_0
$ python
Python 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:33:48)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.15.0-rc2'
This is on a Dell laptop running Ubuntu 18.04 without a GPU, so perhaps the version shown in the interpreter is akin to tensorflow-cpu? If I run pip freeze I see tensorflow==2.0.0 and tensorflow-cpu==1.15.0rc2, which is a bit confusing...
This appears to have been caused by using Python version 3.8, which is currently an unsupported version of Python. Once I created a new Anaconda environment with Python version 3.7 this issue went away.
The only remaining issue is this error that I see when I run pip install -e . for my project which includes tensorflow:
ERROR: tensorflow-cpu 1.15.0rc2 has requirement tensorboard<1.16.0,>=1.15.0, but you'll have tensorboard 2.1.0 which is incompatible.
ERROR: tensorflow-cpu 1.15.0rc2 has requirement tensorflow-estimator==1.15.1, but you'll have tensorflow-estimator 2.1.0 which is incompatible.
So the issue of tensorflow-cpu version 1.15.0rc2 actually being installed when version 2.1.0 shows as being the installed version is still a mystery. To wit:
$ conda list tensorflow
# packages in environment at /home/james/miniconda3/envs/cvd:
#
# Name Version Build Channel
tensorflow 2.1.0 pypi_0 pypi
tensorflow-estimator 2.1.0 pypi_0 pypi
$ python -c "import tensorflow as tf; print(tf.__version__)"
1.15.0-rc2