I am new to deep learning and I have been trying to install tensorflow-gpu version in my pc in vain for the last 2 days. I avoided installing CUDA and cuDNN drivers since several forums online don't recommend it due to numerous compatibility issues. Since I was already using the conda distribution of python before, I went for the conda install -c anaconda tensorflow-gpu as written in their official website here: https://anaconda.org/anaconda/tensorflow-gpu .
However even after installing the gpu version in a fresh virtual environment (to avoid potential conflicts with pip installed libraries in the base env), tensorflow doesn't seem to even recognize my GPU for some mysterious reason.
Some of the code snippets I ran(in anaconda prompt) to understand that it wasn't recognizing my GPU:-
1.
>>>from tensorflow.python.client import device_lib
>>>print(device_lib.list_local_devices())
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 7692219132769779763
]
As you can see it completely ignores the GPU.
2.
>>>tf.debugging.set_log_device_placement(True)
>>>a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
2020-12-13 10:11:30.902956: I tensorflow/core/platform/cpu_feature_guard.cc:142] This
TensorFlow
binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU
instructions in performance-critical operations: AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
>>>b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
>>>c = tf.matmul(a, b)
>>>print(c)
tf.Tensor(
[[22. 28.]
[49. 64.]], shape=(2, 2), dtype=float32)
Here, it was supposed to indicate that it ran with a GPU by showing Executing op MatMul in device /job:localhost/replica:0/task:0/device:GPU:0 (as written here: https://www.tensorflow.org/guide/gpu) but nothing like that is present. Also I am not sure what the message after the 2nd line means.
I have also searched for several solutions online including here but almost all of the issues are related to the first manual installation method which I haven't tried yet since everyone recommended this approach.
I don't use cmd anymore since the environment variables somehow got messed up after uninstalling tensorflow-cpu from the base env and on re-installing, it worked perfectly with anaconda prompt but not cmd. This is a separate issue (and widespread also) but I mentioned it in case that has a role to play here. I installed the gpu version in a fresh virtual environment to ensure a clean installation and as far as I understand path variables need to be set up only for manual installation of CUDA and cuDNN libraries.
The card which I use:-(which is CUDA enabled)
C:\WINDOWS\system32>wmic path win32_VideoController get name
Name
NVIDIA GeForce 940MX
Intel(R) HD Graphics 620
Tensorflow and python version I am using currently:-
>>> import tensorflow as tf
>>> tf.__version__
'2.3.0'
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
System information: Windows 10 Home, 64-bit operating system, x64-based processor.
Any help would be really appreciated. Thanks in advance.
August 2021 Conda install may be working now, as according to #ComputerScientist in the comments below, conda install tensorflow-gpu==2.4.1 will give cudatoolkit-10.1.243 and cudnn-7.6.5
The following was written in Jan 2021 and is out of date
Currently conda install tensorflow-gpu installs tensorflow v2.3.0 and does NOT install the conda cudnn or cudatoolkit packages. Installing them manually (e.g. with conda install cudatoolkit=10.1) does not seem to fix the problem either.
A solution is to install an earlier version of tensorflow, which does install cudnn and cudatoolkit, then upgrade with pip
conda install tensorflow-gpu=2.1
pip install tensorflow-gpu==2.3.1
(2.4.0 uses cuda 11.0 and cudnn 8.0, however cudnn 8.0 is not in anaconda as of 16/12/2020)
Edit: please also see #GZ0's answer, which links to a github discussion with a one-line solution
The tensorflow build automatically selected by Anaconda on Windows 10 during the installation of tensorflow-gpu 2.3 seems to be faulty. Please find a workaround here (consider upvoting the GitHub answer if you have a GitHub account).
Windows only:
Python 3.7: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py37h936c3e2_0
Python 3.8: conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0
#geometrikal solution almost worked for me. But in between installing tensorflow-gpu with conda and installing tensorflow 2.3 with pip, I needed to uninstall the tensorflow parts of the package tensorflow-gpu to avoid conistency warnings by pip. Conda would have uninstalled the whole package. I know Conda does not recommend mixing pip with conda but this is the solution worked that worked and I am tired of spending another day with this issue.
conda create -n tfgpu python=3.7
conda activate tfgpu
conda install tensorflow-gpu=2.1
pip uninstall tensorflow
pip uninstall tensorflow-estimator
pip uninstall tensorboard
pip uninstall tensorboard-plugin-wit
pip install tensorflow==2.3
pip check
I also have been unable (yet) to get TF 2.3.0 to recognize my Nvidia Quadro Pro 620 GPU.
Note: I have 2 other 'environments' on this PC (windows Pro) All installed via Anaconda:
Python 3.7.8 TF 2.0.0... recognizes (and uses) the Nvidia GPU
Python 3.6.9 TF 2.1.0... recognizes (and uses) the Nvidia GPU
Python 3.8.6 TF 2.3.0... does NOT see the GPU
My Machine has Cuda 11.1; cuDNN 8.0.5
My next thought is to consider downgrading Python from 3.8.6 to 3.7.8 in the 3rd configuration where TF = 2.3.0
Steve
You will need to install cuDNN and the CUDA toolkit to use your GPU.
First check for the compatible version here.
cuDNN can be found here (requires free account).
CUDA toolkit can be found here.
Again, check for a compatible version BEFORE installing. Newer versions are not backwards compatible.
I see that your GPU has compute capability 5.0 which is OK, TensorFlow should like it. Thus I assume something went wrong during the environment setup. Please try creating a new environment using:
conda create --name tf_gpu tensorflow-gpu
Then install all other packages you want in tf_gpu and try again.
P.S: it is really important that in the environment you have only one TensorFlow package (the gpu one). If you have more than one, there is no guarantee that
import tensorflow as tf
will import the one you want ...
Using conda to install TensorFlow is always a better way to manage the multi versions of TensorFlow itself as well as CUDA and CUDNN. I recently create a new conda environment and prepare to install the newest TensorFlow too. I also encountered the issue you mentioned. I checked the dependency list from conda install tensorflow-gpu and found that the cudatoolkit and cudnn packages are missing. As the latest version of tensorflow-gpu at Anaconda is 2.3, I think the problem was already pointed out by #GZ0's answer at the GitHub issue.
Here I list the output below:
Using conda install tensorflow=2.3:
PS > conda install tensorflow-gpu=2.3
## Package Plan ##
environment location: C:\Anaconda3\envs\test_cuda_38
added / updated specs:
- tensorflow-gpu=2.3
The following packages will be downloaded:
package | build
---------------------------|-----------------
absl-py-0.12.0 | py38haa95532_0 176 KB
aiohttp-3.7.4 | py38h2bbff1b_1 513 KB
astunparse-1.6.3 | py_0 17 KB
async-timeout-3.0.1 | py38haa95532_0 14 KB
blas-1.0 | mkl 6 KB
blinker-1.4 | py38haa95532_0 23 KB
brotlipy-0.7.0 |py38h2bbff1b_1003 412 KB
cachetools-4.2.1 | pyhd3eb1b0_0 13 KB
cffi-1.14.5 | py38hcd4344a_0 224 KB
chardet-3.0.4 |py38haa95532_1003 194 KB
click-7.1.2 | pyhd3eb1b0_0 64 KB
coverage-5.5 | py38h2bbff1b_2 272 KB
cryptography-3.4.7 | py38h71e12ea_0 643 KB
cython-0.29.23 | py38hd77b12b_0 1.7 MB
gast-0.4.0 | py_0 15 KB
google-auth-1.29.0 | pyhd3eb1b0_0 76 KB
google-auth-oauthlib-0.4.4 | pyhd3eb1b0_0 18 KB
google-pasta-0.2.0 | py_0 46 KB
grpcio-1.36.1 | py38hc60d5dd_1 1.7 MB
h5py-2.10.0 | py38h5e291fa_0 841 KB
hdf5-1.10.4 | h7ebc959_0 7.9 MB
icc_rt-2019.0.0 | h0cc432a_1 6.0 MB
idna-2.10 | pyhd3eb1b0_0 52 KB
importlib-metadata-3.10.0 | py38haa95532_0 34 KB
intel-openmp-2021.2.0 | haa95532_616 1.8 MB
keras-applications-1.0.8 | py_1 29 KB
keras-preprocessing-1.1.2 | pyhd3eb1b0_0 35 KB
libprotobuf-3.14.0 | h23ce68f_0 1.9 MB
markdown-3.3.4 | py38haa95532_0 144 KB
mkl-2021.2.0 | haa95532_296 115.5 MB
mkl-service-2.3.0 | py38h2bbff1b_1 49 KB
mkl_fft-1.3.0 | py38h277e83a_2 137 KB
mkl_random-1.2.1 | py38hf11a4ad_2 223 KB
multidict-5.1.0 | py38h2bbff1b_2 61 KB
numpy-1.20.1 | py38h34a8a5c_0 23 KB
numpy-base-1.20.1 | py38haf7ebc8_0 4.2 MB
oauthlib-3.1.0 | py_0 91 KB
opt_einsum-3.1.0 | py_0 54 KB
protobuf-3.14.0 | py38hd77b12b_1 242 KB
pyasn1-0.4.8 | py_0 57 KB
pyasn1-modules-0.2.8 | py_0 72 KB
pycparser-2.20 | py_2 94 KB
pyjwt-1.7.1 | py38_0 48 KB
pyopenssl-20.0.1 | pyhd3eb1b0_1 49 KB
pyreadline-2.1 | py38_1 145 KB
pysocks-1.7.1 | py38haa95532_0 31 KB
requests-2.25.1 | pyhd3eb1b0_0 52 KB
requests-oauthlib-1.3.0 | py_0 23 KB
rsa-4.7.2 | pyhd3eb1b0_1 28 KB
scipy-1.6.2 | py38h66253e8_1 13.0 MB
tensorboard-plugin-wit-1.6.0| py_0 630 KB
tensorflow-2.3.0 |mkl_py38h8557ec7_0 6 KB
tensorflow-base-2.3.0 |eigen_py38h75a453f_0 49.5 MB
tensorflow-estimator-2.3.0 | pyheb71bc4_0 271 KB
termcolor-1.1.0 | py38haa95532_1 9 KB
typing-extensions-3.7.4.3 | hd3eb1b0_0 12 KB
typing_extensions-3.7.4.3 | pyh06a4308_0 28 KB
urllib3-1.26.4 | pyhd3eb1b0_0 105 KB
werkzeug-1.0.1 | pyhd3eb1b0_0 239 KB
win_inet_pton-1.1.0 | py38haa95532_0 35 KB
wrapt-1.12.1 | py38he774522_1 49 KB
yarl-1.6.3 | py38h2bbff1b_0 153 KB
------------------------------------------------------------
Total: 210.0 MB
Using conda install tensorflow=2.1:
PS > conda install tensorflow-gpu=2.1
## Package Plan ##
environment location: C:\Anaconda3\envs\test_cuda
added / updated specs:
- tensorflow-gpu=2.1
The following packages will be downloaded:
package | build
---------------------------|-----------------
_tflow_select-2.1.0 | gpu 3 KB
absl-py-0.12.0 | py37haa95532_0 175 KB
aiohttp-3.7.4 | py37h2bbff1b_1 507 KB
astor-0.8.1 | py37haa95532_0 47 KB
async-timeout-3.0.1 | py37haa95532_0 14 KB
blas-1.0 | mkl 6 KB
blinker-1.4 | py37haa95532_0 23 KB
brotlipy-0.7.0 |py37h2bbff1b_1003 337 KB
cachetools-4.2.1 | pyhd3eb1b0_0 13 KB
cffi-1.14.5 | py37hcd4344a_0 220 KB
chardet-3.0.4 |py37haa95532_1003 192 KB
click-7.1.2 | pyhd3eb1b0_0 64 KB
coverage-5.5 | py37h2bbff1b_2 273 KB
cryptography-3.4.7 | py37h71e12ea_0 641 KB
cudatoolkit-10.1.243 | h74a9793_0 300.3 MB
cudnn-7.6.5 | cuda10.1_0 179.1 MB
cython-0.29.23 | py37hd77b12b_0 1.7 MB
gast-0.2.2 | py37_0 155 KB
google-auth-1.29.0 | pyhd3eb1b0_0 76 KB
google-auth-oauthlib-0.4.4 | pyhd3eb1b0_0 18 KB
google-pasta-0.2.0 | py_0 46 KB
grpcio-1.36.1 | py37hc60d5dd_1 1.7 MB
h5py-2.10.0 | py37h5e291fa_0 808 KB
hdf5-1.10.4 | h7ebc959_0 7.9 MB
icc_rt-2019.0.0 | h0cc432a_1 6.0 MB
idna-2.10 | pyhd3eb1b0_0 52 KB
importlib-metadata-3.10.0 | py37haa95532_0 34 KB
intel-openmp-2021.2.0 | haa95532_616 1.8 MB
keras-applications-1.0.8 | py_1 29 KB
keras-preprocessing-1.1.2 | pyhd3eb1b0_0 35 KB
libprotobuf-3.14.0 | h23ce68f_0 1.9 MB
markdown-3.3.4 | py37haa95532_0 144 KB
mkl-2021.2.0 | haa95532_296 115.5 MB
mkl-service-2.3.0 | py37h2bbff1b_1 48 KB
mkl_fft-1.3.0 | py37h277e83a_2 133 KB
mkl_random-1.2.1 | py37hf11a4ad_2 214 KB
multidict-5.1.0 | py37h2bbff1b_2 85 KB
numpy-1.20.1 | py37h34a8a5c_0 23 KB
numpy-base-1.20.1 | py37haf7ebc8_0 4.1 MB
oauthlib-3.1.0 | py_0 91 KB
opt_einsum-3.1.0 | py_0 54 KB
protobuf-3.14.0 | py37hd77b12b_1 240 KB
pyasn1-0.4.8 | py_0 57 KB
pyasn1-modules-0.2.8 | py_0 72 KB
pycparser-2.20 | py_2 94 KB
pyjwt-1.7.1 | py37_0 49 KB
pyopenssl-20.0.1 | pyhd3eb1b0_1 49 KB
pyreadline-2.1 | py37_1 143 KB
pysocks-1.7.1 | py37_1 28 KB
requests-2.25.1 | pyhd3eb1b0_0 52 KB
requests-oauthlib-1.3.0 | py_0 23 KB
rsa-4.7.2 | pyhd3eb1b0_1 28 KB
scipy-1.6.2 | py37h66253e8_1 12.8 MB
six-1.15.0 | py37haa95532_0 51 KB
tensorboard-plugin-wit-1.6.0| py_0 630 KB
tensorflow-2.1.0 |gpu_py37h7db9008_0 4 KB
tensorflow-base-2.1.0 |gpu_py37h55f5790_0 105.3 MB
tensorflow-estimator-2.1.0 | pyhd54b08b_0 251 KB
tensorflow-gpu-2.1.0 | h0d30ee6_0 3 KB
termcolor-1.1.0 | py37haa95532_1 9 KB
typing-extensions-3.7.4.3 | hd3eb1b0_0 12 KB
typing_extensions-3.7.4.3 | pyh06a4308_0 28 KB
urllib3-1.26.4 | pyhd3eb1b0_0 105 KB
werkzeug-0.16.1 | py_0 258 KB
win_inet_pton-1.1.0 | py37haa95532_0 35 KB
wrapt-1.12.1 | py37he774522_1 49 KB
yarl-1.6.3 | py37h2bbff1b_0 151 KB
------------------------------------------------------------
Total: 745.0 MB
Therefore, you may install the latest version (v2.3) of tensorflow-gpu from Anaconda on Windows platform using the advises from #GZ0 and #geometrikal, or just using conda install tensorflow-gpu=2.1 to get the newest and right environment.
Notice that tensorflow-gpu v2.1 only support Python between 3.5-3.7.
As of August 2021, with TensorFlow 2.4.1, I believe it seems to install CUDA and CuDNN in a conda environment. Here's what I did to create a fresh conda env on an Ubuntu 18.04 machine:
conda create --name tftest python=3.7 -y && conda activate tftest
conda install ipython tensorflow-gpu==2.4.1 -y
The command above will list the following packages to be installed. For our purposes, note how cudatoolkit and cudnn are listed.
The following packages will be downloaded:
package | build
---------------------------|-----------------
_tflow_select-2.1.0 | gpu 2 KB
absl-py-0.13.0 | py37h06a4308_0 173 KB
aiohttp-3.7.4 | py37h27cfd23_1 536 KB
astor-0.8.1 | py37h06a4308_0 47 KB
astunparse-1.6.3 | py_0 17 KB
async-timeout-3.0.1 | py37h06a4308_0 13 KB
attrs-21.2.0 | pyhd3eb1b0_0 46 KB
backcall-0.2.0 | pyhd3eb1b0_0 13 KB
blas-1.0 | mkl 6 KB
blinker-1.4 | py37h06a4308_0 23 KB
brotlipy-0.7.0 |py37h27cfd23_1003 320 KB
c-ares-1.17.1 | h27cfd23_0 108 KB
cachetools-4.2.2 | pyhd3eb1b0_0 13 KB
cffi-1.14.6 | py37h400218f_0 223 KB
chardet-3.0.4 |py37h06a4308_1003 175 KB
charset-normalizer-2.0.4 | pyhd3eb1b0_0 35 KB
click-8.0.1 | pyhd3eb1b0_0 79 KB
coverage-5.5 | py37h27cfd23_2 254 KB
cryptography-3.4.7 | py37hd23ed53_0 904 KB
cudatoolkit-10.1.243 | h6bb024c_0 347.4 MB
cudnn-7.6.5 | cuda10.1_0 179.9 MB
cupti-10.1.168 | 0 1.4 MB
cython-0.29.24 | py37h295c915_0 1.9 MB
decorator-5.0.9 | pyhd3eb1b0_0 12 KB
gast-0.4.0 | pyhd3eb1b0_0 13 KB
google-auth-1.33.0 | pyhd3eb1b0_0 80 KB
google-auth-oauthlib-0.4.4 | pyhd3eb1b0_0 18 KB
google-pasta-0.2.0 | py_0 46 KB
grpcio-1.36.1 | py37h2157cd5_1 1.9 MB
h5py-2.10.0 | py37hd6299e0_1 902 KB
hdf5-1.10.6 | hb1b8bf9_0 3.7 MB
idna-3.2 | pyhd3eb1b0_0 48 KB
importlib-metadata-3.10.0 | py37h06a4308_0 33 KB
intel-openmp-2021.3.0 | h06a4308_3350 1.4 MB
ipython-7.26.0 | py37hb070fc8_0 1005 KB
ipython_genutils-0.2.0 | pyhd3eb1b0_1 27 KB
jedi-0.18.0 | py37h06a4308_1 911 KB
keras-preprocessing-1.1.2 | pyhd3eb1b0_0 35 KB
libgfortran-ng-7.5.0 | ha8ba4b0_17 22 KB
libgfortran4-7.5.0 | ha8ba4b0_17 995 KB
libprotobuf-3.17.2 | h4ff587b_1 2.0 MB
markdown-3.3.4 | py37h06a4308_0 127 KB
matplotlib-inline-0.1.2 | pyhd3eb1b0_2 12 KB
mkl-2021.3.0 | h06a4308_520 141.2 MB
mkl-service-2.4.0 | py37h7f8727e_0 56 KB
mkl_fft-1.3.0 | py37h42c9631_2 170 KB
mkl_random-1.2.2 | py37h51133e4_0 287 KB
multidict-5.1.0 | py37h27cfd23_2 66 KB
numpy-1.20.3 | py37hf144106_0 23 KB
numpy-base-1.20.3 | py37h74d4b33_0 4.5 MB
oauthlib-3.1.1 | pyhd3eb1b0_0 90 KB
opt_einsum-3.3.0 | pyhd3eb1b0_1 57 KB
parso-0.8.2 | pyhd3eb1b0_0 69 KB
pexpect-4.8.0 | pyhd3eb1b0_3 53 KB
pickleshare-0.7.5 | pyhd3eb1b0_1003 13 KB
prompt-toolkit-3.0.17 | pyh06a4308_0 256 KB
protobuf-3.17.2 | py37h295c915_0 319 KB
ptyprocess-0.7.0 | pyhd3eb1b0_2 17 KB
pyasn1-0.4.8 | py_0 57 KB
pyasn1-modules-0.2.8 | py_0 72 KB
pygments-2.10.0 | pyhd3eb1b0_0 725 KB
pyjwt-2.1.0 | py37h06a4308_0 32 KB
pyopenssl-20.0.1 | pyhd3eb1b0_1 49 KB
pysocks-1.7.1 | py37_1 27 KB
python-flatbuffers-1.12 | pyhd3eb1b0_0 24 KB
requests-2.26.0 | pyhd3eb1b0_0 59 KB
requests-oauthlib-1.3.0 | py_0 23 KB
rsa-4.7.2 | pyhd3eb1b0_1 28 KB
scipy-1.6.2 | py37had2a1c9_1 15.5 MB
six-1.16.0 | pyhd3eb1b0_0 18 KB
tensorboard-2.4.0 | pyhc547734_0 8.8 MB
tensorboard-plugin-wit-1.6.0| py_0 630 KB
tensorflow-2.4.1 |gpu_py37ha2e99fa_0 4 KB
tensorflow-base-2.4.1 |gpu_py37h29c2da4_0 195.2 MB
tensorflow-estimator-2.5.0 | pyh7b7c402_0 267 KB
tensorflow-gpu-2.4.1 | h30adc30_0 3 KB
termcolor-1.1.0 | py37h06a4308_1 9 KB
traitlets-5.0.5 | pyhd3eb1b0_0 81 KB
typing-extensions-3.10.0.0 | hd3eb1b0_0 8 KB
typing_extensions-3.10.0.0 | pyh06a4308_0 27 KB
urllib3-1.26.6 | pyhd3eb1b0_1 112 KB
wcwidth-0.2.5 | py_0 29 KB
werkzeug-1.0.1 | pyhd3eb1b0_0 239 KB
wrapt-1.12.1 | py37h7b6447c_1 49 KB
yarl-1.6.3 | py37h27cfd23_0 133 KB
zipp-3.5.0 | pyhd3eb1b0_0 13 KB
------------------------------------------------------------
Total: 915.9 MB
Next, run ipython and try:
In [1]: import tensorflow as tf
2021-08-29 12:26:36.582384: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
In [2]: tf.config.list_physical_devices('GPU')
2021-08-29 12:26:48.676151: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
2021-08-29 12:26:48.679894: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
2021-08-29 12:26:48.975002: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:04:00.0 name: Tesla V100-PCIE-32GB computeCapability: 7.0
coreClock: 1.38GHz coreCount: 80 deviceMemorySize: 31.75GiB deviceMemoryBandwidth: 836.37GiB/s
2021-08-29 12:26:48.979341: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 1 with properties:
pciBusID: 0000:08:00.0 name: Tesla V100-PCIE-32GB computeCapability: 7.0
coreClock: 1.38GHz coreCount: 80 deviceMemorySize: 31.75GiB deviceMemoryBandwidth: 836.37GiB/s
2021-08-29 12:26:48.981747: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 2 with properties:
pciBusID: 0000:09:00.0 name: Tesla V100-PCIE-32GB computeCapability: 7.0
coreClock: 1.38GHz coreCount: 80 deviceMemorySize: 31.75GiB deviceMemoryBandwidth: 836.37GiB/s
2021-08-29 12:26:48.990002: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 3 with properties:
pciBusID: 0000:85:00.0 name: Tesla V100-PCIE-32GB computeCapability: 7.0
coreClock: 1.38GHz coreCount: 80 deviceMemorySize: 31.75GiB deviceMemoryBandwidth: 836.37GiB/s
2021-08-29 12:26:48.992488: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 4 with properties:
pciBusID: 0000:89:00.0 name: Tesla V100-PCIE-32GB computeCapability: 7.0
coreClock: 1.38GHz coreCount: 80 deviceMemorySize: 31.75GiB deviceMemoryBandwidth: 836.37GiB/s
2021-08-29 12:26:48.992523: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
2021-08-29 12:26:49.312793: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.10
2021-08-29 12:26:49.312907: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.10
2021-08-29 12:26:49.388961: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10
2021-08-29 12:26:49.413946: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10
2021-08-29 12:26:49.535055: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10
2021-08-29 12:26:49.563142: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.10
2021-08-29 12:26:50.009291: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.7
2021-08-29 12:26:50.051301: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0, 1, 2, 3, 4
Out[2]:
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:1', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:2', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:3', device_type='GPU'),
PhysicalDevice(name='/physical_device:GPU:4', device_type='GPU')]
In [3]: tf.test.is_built_with_cuda()
Out[3]: True
This machine has 5 GPUs, so the above output is correct.
What I'm not actually sure about is why CUDA 10.1 and CuDNN 7.6.5 are installed, since it seems like from Google's TF compatibility chart that 2.4.0 (and presumably 2.4.1?) work with CUDA 11.0 and CuDNN 8. If anyone has insights on that, feel free to chime in...
In my case (In April 2022):
conda install tensorflow-gpu=2.3 tensorflow=2.3=mkl_py38h1fcfbd6_0 cudatoolkit cudnn keras matplotlib
Works perfectly!! it installed tensorflow-gpu=2.3 - cudatoolkit 10.1.243 and cudnn 7.6.5
Updated April 26, 2022, tensorflow 2.6.0 does the job,
Python version 3.8.13
Recap - in Anaconda Jupyter, encountered the same "GPU no show" issue
'2.3.0'
Followed the procedure in this link, again "GPU no show".
Trial and error: workaround below does the job.
Launch CMD window from Navigator (the same environment);
conda install tensorflow=2.6.0 –-channel conda-forge -y;
It will take some time (collecting package, resolving environment etc.);
In this case, automatically update CUDA and cuDNN versions to 11.3 and 8.2, respectively.
After it is done, exit Anaconda and restart the computer.
Return to Jupyter, run the cell:
cell
and check result:
2.6.0
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
Following Steps worked for me:
Do the same as in the video.
https://www.youtube.com/watch?v=r31jnE7pR-g
Also install tensorflow estimator which is missing in the video. In picture you can see my environment which is working for me.
my environment
Maybe you have to change the versions to the same ones.
Now go in Visual Code and run your code with the anaconda environment you created before. See picture below.
select your environment
In my case it it tf_env, what i created and named.
Try to run your code. If Visual Code says something is missing try to install it with the anaconda terminal. Click the "play"-Button to start the terminal.
play Button terminal
Also close and open Visual Code when you do changes, sometimes anaconda too. Now try this code below.
> print("Num GPU: ", len(tf.config.list_physical_devices("GPU")))
>
> print(tf.test.is_gpu_available()) print(tf.test.is_built_with_cuda())
> OUTPUT
> Num GPU: 1
> WARNING:tensorflow:From <ipython-input-2-8748de971110>:3:
> is_gpu_available (from tensorflow.python.framework.test_util) is
> deprecated and will be removed in a future version. Instructions for
> updating: Use `tf.config.list_physical_devices('GPU')` instead.
> True
> True
If your output is the same, everything went fine. Now when you train a model you should see your gpu running in your task manager.
Hopefully it helps you guys :)
Related
I am getting a similar error while trying to import Seaborn into IBM Watson Studio for my Data Science Final Assignment. Could someone please help?
I checked Seaborn already exists in packages. However, when I try to install Conda using below command
!conda install -c anaconda seaborn -y
I get the following warnings/errors.
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
## Package Plan ##
environment location: /opt/conda/envs/Python-3.7-main
added / updated specs:
- seaborn
The following packages will be downloaded:
package | build
---------------------------|-----------------
entrypoints-0.3 | py37_0 12 KB anaconda
fontconfig-2.13.0 | h9420a91_0 291 KB anaconda
icu-58.2 | he6710b0_3 22.7 MB anaconda
jupyter_client-6.1.7 | py_0 76 KB anaconda
libpng-1.6.37 | hbc83047_0 364 KB anaconda
libuuid-1.0.3 | h1bed415_2 16 KB anaconda
libxcb-1.14 | h7b6447c_0 610 KB anaconda
libxml2-2.9.10 | hb55368b_3 1.3 MB anaconda
lz4-c-1.9.2 | heb0550a_3 203 KB anaconda
markupsafe-1.1.1 | py37h14c3975_1 26 KB anaconda
mistune-0.8.4 |py37h14c3975_1001 53 KB anaconda
ncurses-6.2 | he6710b0_1 1.1 MB anaconda
packaging-20.4 | py_0 35 KB anaconda
pandocfilters-1.4.2 | py37_1 13 KB anaconda
pyjwt-1.7.1 | py37_0 32 KB anaconda
webencodings-0.5.1 | py37_1 19 KB anaconda
------------------------------------------------------------
Total: 26.8 MB
The following NEW packages will be INSTALLED:
The following packages will be DOWNGRADED:
ibm-wsrt-py37main~ 0.0.0-2020 --> custom-2020
Downloading and Extracting Packages
icu-58.2 | 22.7 MB | ###################################9 | 97% WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename /opt/conda/pkgs/icu-58.2-he6710b0_3/share/icu/58.2/config/mh-linux. Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename /opt/conda/pkgs/icu-58.2-he6710b0_3/share/icu/58.2/install-sh. Please remove this file manually (you may need to reboot to free file handles)
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140): Could not remove or rename /opt/conda/pkgs/icu-58.2-he6710b0_3/share/icu/58.2/LICENSE. Please remove this file manually (you may need to reboot to free file handles)
InvalidArchiveError('Error with archive /opt/conda/pkgs/jupyter_client-6.1.7-py_0.tar.bz2. You probably need to delete and re-download or re-create this file. Message from libarchive was:\n\nCould not unlink')}
I am trying to resolve below issue with many permutation combination but end-up with some issue.
Environment used:
python 3.8.3 Anaconda 1.9.12 ,
Tensorflow CPU version 2.3 which supports python 3.8 as per Tensorflow website.
Created new environment in Anaconda for this.
I also degrade python 3.6 version with same Tensorflow version but same issue.
I chose interpreter path as new environment path ( tried python.exe and pythonw.exe both)
I used pip installer to install Tensorflow.
Brief error desc:
ImportError: DLL load failed while importing
_pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
Work around:
I have created new environment in Anaconda and installed with above environment settings
Error console: raceback (most recent call last): File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed while importing
_pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Vid/PycharmProjects/pythonProject/test.py", line 1, in <module>
import tensorflow
File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe
File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Vid\anaconda3\envs\tensor\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: A dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Process finished with exit code 1
Help Request:
Can anyone here help me to resolve the issue. Where I am doing mistake? I tried various version of python but seems it is not working.
I have seen many solution provided here like..
Degrade python version till 3.6
Tensor installation using conda install..
Installing MS VC++ 2015 package
, etc..
But I have not degraded Tensorflow version because its mentioned the latest version can run for python 3.8.
Thanks in advance.
** Issue Resolved **
Solution:
As I was using Anaconda so as per advise from anaconda its better to install the tensorflow using conda install command (https://www.anaconda.com/blog/tensorflow-in-anaconda). Conda installation ensured all the python and tensor dependencies version and packages will be taken care. Refer to below package which has suggested to during my conda installation.
Command and package file details are below..
Automatically Anaconda chose Tensorflow 2.2.0 version (While for my case during pip installation it was 2.3.0. Python 3.7.9 version while I had Python 3.8.3)
Console content:
(base) C:\Users\Vid>conda create -n tensor tensorflow
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done
Package Plan
environment location: C:\Users\Vid\anaconda3\envs\tensor
added / updated specs:
- tensorflow
The following packages will be downloaded:
package | build
---------------------------|-----------------
_tflow_select-2.2.0 | eigen 3 KB
absl-py-0.9.0 | py37_0 168 KB
astor-0.8.1 | py37_0 47 KB
blinker-1.4 | py37_0 22 KB
brotlipy-0.7.0 |py37he774522_1000 336 KB
cachetools-4.1.1 | py_0 12 KB
certifi-2020.6.20 | py37_0 156 KB
cffi-1.14.2 | py37h7a1dbc1_0 227 KB
chardet-3.0.4 | py37_1003 193 KB
cryptography-3.1 | py37h7a1dbc1_0 536 KB
gast-0.2.2 | py37_0 155 KB
google-auth-1.21.1 | py_0 56 KB
google-auth-oauthlib-0.4.1 | py_2 20 KB
google-pasta-0.2.0 | py_0 46 KB
grpcio-1.31.0 | py37he7da953_0 1.5 MB
h5py-2.10.0 | py37h5e291fa_0 808 KB
importlib-metadata-1.7.0 | py37_0 52 KB
intel-openmp-2020.2 | 254 1.6 MB
keras-applications-1.0.8 | py_1 29 KB
keras-preprocessing-1.1.0 | py_1 37 KB
libprotobuf-3.13.0 | h200bbdf_0 1.8 MB
markdown-3.2.2 | py37_0 136 KB
mkl-2020.2 | 256 109.3 MB
mkl-service-2.3.0 | py37hb782905_0 210 KB
mkl_fft-1.1.0 | py37h45dec08_0 116 KB
mkl_random-1.1.1 | py37h47e9c7a_0 233 KB
numpy-1.19.1 | py37h5510c5b_0 22 KB
numpy-base-1.19.1 | py37ha3acd2a_0 3.8 MB
oauthlib-3.1.0 | py_0 91 KB
opt_einsum-3.1.0 | py_0 54 KB
pip-20.2.2 | py37_0 1.7 MB
protobuf-3.13.0 | py37h6538335_0 535 KB
pyasn1-0.4.8 | py_0 57 KB
pyasn1-modules-0.2.7 | py_0 68 KB
pyjwt-1.7.1 | py37_0 49 KB
pyreadline-2.1 | py37_1 143 KB
pysocks-1.7.1 | py37_1 28 KB
python-3.7.9 | h60c2a47_0 14.4 MB
requests-oauthlib-1.3.0 | py_0 23 KB
rsa-4.6 | py_0 26 KB
scipy-1.5.2 | py37h9439919_0 11.8 MB
setuptools-49.6.0 | py37_0 771 KB
tensorboard-2.2.1 | pyh532a8cf_0 2.4 MB
tensorboard-plugin-wit-1.6.0| py_0 630 KB
tensorflow-2.1.0 |eigen_py37hd727fc0_0 4 KB
tensorflow-base-2.1.0 |eigen_py37h49b2757_0 35.4 MB
tensorflow-estimator-2.1.0 | pyhd54b08b_0 251 KB
termcolor-1.1.0 | py37_1 8 KB
urllib3-1.25.10 | py_0 98 KB
werkzeug-0.16.1 | py_0 258 KB
win_inet_pton-1.1.0 | py37_0 9 KB
wincertstore-0.2 | py37_0 14 KB
wrapt-1.12.1 | py37he774522_1 49 KB
------------------------------------------------------------
Total: 190.4 MB
Thanks
I faced the same issue a couple of days back.
I would suggest you to download Anaconda 2020.02 for a seamlessly smooth experience with TensorFlow 2.
After installation;
You can execute the following instructions and command to solve the issue: (do not include inverted commas)
Open Anaconda Prompt
type: "create --name py3-TF2.0 python = 3"
press "y" to continue
After successful completion:
type "conda activate py3-TF2.0"
type "pip install matplotlib"
type "pip install tensorflow==2.3.0"
type "conda deactivate"
type "pip install ipykernel"
type "conda install nb_conda_kernels"
Now exit the Anaconda prompt and open the Anaconda Navigator application. Switch to "py3-TF2.0" from the base environment using the Environment tab. Install Jupyter in the specified environment. After successful installation, open Jupyter notebook and switch to "py3-TF2.0" kernel using Kernel Tab. You're good to go for using TensorFlow 2.
I am trying to use Facebook Prophet on an AWS Sagemaker Jupyter notebook. I've tried installing fbprophet in two ways:
!{sys.executable} -m pip install fbprophet
and
!conda install -c conda-forge fbprophet --yes
(that last one comes from several answers I saw on other forums)
However, none of them seem to work. In particular, the latest one seems to work for the installation, but the subsequent import of fbprophet results in an error, that seems related to matplotlib:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-d9f3d4c04a60> in <module>()
1 # Imports
----> 2 from fbprophet import Prophet
~/anaconda3/envs/python3/lib/python3.6/site-packages/fbprophet/__init__.py in <module>()
6 # of patent rights can be found in the PATENTS file in the same directory.
7
----> 8 from fbprophet.forecaster import Prophet
9
10 __version__ = '0.6'
~/anaconda3/envs/python3/lib/python3.6/site-packages/fbprophet/forecaster.py in <module>()
17 from fbprophet.make_holidays import get_holiday_names, make_holidays_df
18 from fbprophet.models import StanBackendEnum
---> 19 from fbprophet.plot import (plot, plot_components)
20
21 logger = logging.getLogger('fbprophet')
~/anaconda3/envs/python3/lib/python3.6/site-packages/fbprophet/plot.py in <module>()
19
20 try:
---> 21 from matplotlib import pyplot as plt
22 from matplotlib.dates import (
23 MonthLocator,
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/pyplot.py in <module>()
30 from cycler import cycler
31 import matplotlib
---> 32 import matplotlib.colorbar
33 import matplotlib.image
34 from matplotlib import rcsetup, style
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/colorbar.py in <module>()
25
26 import matplotlib as mpl
---> 27 import matplotlib.artist as martist
28 import matplotlib.cbook as cbook
29 import matplotlib.collections as collections
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/artist.py in <module>()
55
56
---> 57 class Artist(object):
58 """
59 Abstract base class for objects that render into a FigureCanvas.
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/artist.py in Artist()
62 """
63 #cbook.deprecated("3.1")
---> 64 #property
65 def aname(self):
66 return 'Artist'
~/anaconda3/envs/python3/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py in deprecate(obj, message, name, alternative, pending, addendum)
180 pass
181 """
--> 182
183 def deprecate(obj, message=message, name=name, alternative=alternative,
184 pending=pending, obj_type=obj_type, addendum=addendum):
AttributeError: 'property' object has no attribute '__name__'
Has anyone else run into this issue / managed to get fbprophet working on sagemaker? I'm thinking this might be an issue of versions of fbprophet and matplotlib, but couldn't find information on which ones to use.
The following works for me on a fresh notebook instance. I'm using the python3 environment.
sh-4.2$ source activate python3
(python3) sh-4.2$ conda install -c conda-forge fbprophet --yes
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.5.12
latest version: 4.8.2
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/ec2-user/anaconda3/envs/python3
added / updated specs:
- fbprophet
The following packages will be downloaded:
package | build
---------------------------|-----------------
pykerberos-1.2.1 | py36h505690d_0 26 KB conda-forge
python-3.6.7 | h381d211_1004 34.5 MB conda-forge
cryptography-2.8 | py36h45558ae_2 628 KB conda-forge
python_abi-3.6 | 1_cp36m 4 KB conda-forge
binutils_impl_linux-64-2.33.1| h53a641e_8 9.1 MB conda-forge
certifi-2019.11.28 | py36h9f0ad1d_1 149 KB conda-forge
gcc_linux-64-7.3.0 | h553295d_17 21 KB conda-forge
gxx_linux-64-7.3.0 | h553295d_17 21 KB conda-forge
fbprophet-0.6 | py36he1b5a44_0 642 KB conda-forge
holidays-0.10.1 | py_0 56 KB conda-forge
tk-8.6.10 | hed695b0_0 3.2 MB conda-forge
lunarcalendar-0.0.9 | py_0 20 KB conda-forge
convertdate-2.1.3 | py_1000 30 KB conda-forge
curl-7.68.0 | hf8cf82a_0 137 KB conda-forge
krb5-1.16.4 | h2fd8d38_0 1.4 MB conda-forge
libcurl-7.68.0 | hda55be3_0 564 KB conda-forge
expat-2.2.9 | he1b5a44_2 191 KB conda-forge
binutils_linux-64-2.33.1 | h9595d00_17 21 KB conda-forge
python-dateutil-2.8.0 | py_0 219 KB conda-forge
matplotlib-base-3.1.0 | py36h5f35d83_0 6.7 MB conda-forge
pycurl-7.43.0.5 | py36h16ce93b_0 69 KB conda-forge
ld_impl_linux-64-2.33.1 | h53a641e_8 589 KB conda-forge
pystan-2.17.1.0 |py36hf2d7682_1004 14.0 MB conda-forge
ephem-3.7.7.1 | py36h516909a_0 722 KB conda-forge
------------------------------------------------------------
Total: 72.9 MB
The following NEW packages will be INSTALLED:
binutils_impl_linux-64: 2.33.1-h53a641e_8 conda-forge
binutils_linux-64: 2.33.1-h9595d00_17 conda-forge
convertdate: 2.1.3-py_1000 conda-forge
ephem: 3.7.7.1-py36h516909a_0 conda-forge
fbprophet: 0.6-py36he1b5a44_0 conda-forge
gcc_impl_linux-64: 7.3.0-habb00fd_1
gcc_linux-64: 7.3.0-h553295d_17 conda-forge
gettext: 0.19.8.1-hc5be6a0_1002 conda-forge
gxx_impl_linux-64: 7.3.0-hdf63c60_1
gxx_linux-64: 7.3.0-h553295d_17 conda-forge
holidays: 0.10.1-py_0 conda-forge
ld_impl_linux-64: 2.33.1-h53a641e_8 conda-forge
lunarcalendar: 0.0.9-py_0 conda-forge
matplotlib-base: 3.1.0-py36h5f35d83_0 conda-forge
pystan: 2.17.1.0-py36hf2d7682_1004 conda-forge
python_abi: 3.6-1_cp36m conda-forge
The following packages will be UPDATED:
ca-certificates: 2019.10.16-0 --> 2019.11.28-hecc5488_0 conda-forge
certifi: 2019.9.11-py36_0 --> 2019.11.28-py36h9f0ad1d_1 conda-forge
cryptography: 2.2.2-py36h14c3975_0 --> 2.8-py36h45558ae_2 conda-forge
curl: 7.60.0-h84994c4_0 --> 7.68.0-hf8cf82a_0 conda-forge
expat: 2.2.5-he0dffb1_0 --> 2.2.9-he1b5a44_2 conda-forge
glib: 2.56.1-h000015b_0 --> 2.58.3-h6f030ca_1002 conda-forge
krb5: 1.14.2-hcdc1b81_6 --> 1.16.4-h2fd8d38_0 conda-forge
libcurl: 7.60.0-h1ad7b7a_0 --> 7.68.0-hda55be3_0 conda-forge
libpng: 1.6.34-hb9fc6fc_0 --> 1.6.37-hed695b0_0 conda-forge
libssh2: 1.8.0-h9cfc8f7_4 --> 1.8.2-h22169c7_2 conda-forge
openssl: 1.0.2t-h7b6447c_1 --> 1.1.1d-h516909a_0 conda-forge
pycurl: 7.43.0.1-py36hb7f436b_0 --> 7.43.0.5-py36h16ce93b_0 conda-forge
pykerberos: 1.2.1-py36h14c3975_0 --> 1.2.1-py36h505690d_0 conda-forge
python: 3.6.5-hc3d631a_2 --> 3.6.7-h381d211_1004 conda-forge
python-dateutil: 2.7.3-py36_0 --> 2.8.0-py_0 conda-forge
qt: 5.9.6-h52aff34_0 --> 5.9.7-h5867ecd_1
sqlite: 3.23.1-he433501_0 --> 3.28.0-h8b20d00_0 conda-forge
tk: 8.6.7-hc745277_3 --> 8.6.10-hed695b0_0 conda-forge
Downloading and Extracting Packages
pykerberos-1.2.1 | 26 KB | ################################################################################ | 100%
python-3.6.7 | 34.5 MB | ################################################################################ | 100%
cryptography-2.8 | 628 KB | ################################################################################ | 100%
python_abi-3.6 | 4 KB | ################################################################################ | 100%
binutils_impl_linux- | 9.1 MB | ################################################################################ | 100%
certifi-2019.11.28 | 149 KB | ################################################################################ | 100%
gcc_linux-64-7.3.0 | 21 KB | ################################################################################ | 100%
gxx_linux-64-7.3.0 | 21 KB | ################################################################################ | 100%
fbprophet-0.6 | 642 KB | ################################################################################ | 100%
holidays-0.10.1 | 56 KB | ################################################################################ | 100%
tk-8.6.10 | 3.2 MB | ################################################################################ | 100%
lunarcalendar-0.0.9 | 20 KB | ################################################################################ | 100%
convertdate-2.1.3 | 30 KB | ################################################################################ | 100%
curl-7.68.0 | 137 KB | ################################################################################ | 100%
krb5-1.16.4 | 1.4 MB | ################################################################################ | 100%
libcurl-7.68.0 | 564 KB | ################################################################################ | 100%
expat-2.2.9 | 191 KB | ################################################################################ | 100%
binutils_linux-64-2. | 21 KB | ################################################################################ | 100%
python-dateutil-2.8. | 219 KB | ################################################################################ | 100%
matplotlib-base-3.1. | 6.7 MB | ################################################################################ | 100%
pycurl-7.43.0.5 | 69 KB | ################################################################################ | 100%
ld_impl_linux-64-2.3 | 589 KB | ################################################################################ | 100%
pystan-2.17.1.0 | 14.0 MB | ################################################################################ | 100%
ephem-3.7.7.1 | 722 KB | ################################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(python3) sh-4.2$
(python3) sh-4.2$
(python3) sh-4.2$
(python3) sh-4.2$ python
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fbprophet
>>>
I want to install cvxopt in Anaconda Python. Here's the version of my software:
$ python --version
Python 3.6.5 :: Anaconda, Inc.
$ conda --version
conda 4.5.11
$ anaconda --version
anaconda Command line client (version 1.6.14)
I try to install by typing:
conda install cvxopt
I was prompted that about 40 packages will be downloaded, about 10 NEW packages will be installed, the package anaconda will be removed, and about 25 packages will be updated?
Are the NEW packages dependencies?
Why will conda remove the anaconda package? Isn't conda a part of anaconda?
Here is the full output:
Solving environment: done
## Package Plan ##
environment location: /usr/local/anaconda3
added / updated specs:
- cvxopt
The following packages will be downloaded:
package | build
---------------------------|-----------------
suitesparse-5.2.0 | h171a5a3_0 2.4 MB
openssl-1.1.1a | h7b6447c_0 5.0 MB
freetype-2.9.1 | h8a8886c_1 822 KB
harfbuzz-1.8.8 | hffaf4a1_0 863 KB
libssh2-1.8.0 | h1ba5d50_4 233 KB
cairo-1.14.12 | h8948797_3 1.3 MB
libstdcxx-ng-8.2.0 | hdf63c60_1 2.9 MB
conda-4.6.1 | py36_0 1.7 MB
glpk-4.65 | h3ceedfd_2 1.1 MB
expat-2.2.6 | he6710b0_0 187 KB
krb5-1.16.1 | h173b8e3_7 1.4 MB
tbb-2018.0.5 | h6bb024c_0 1.4 MB
sqlite-3.26.0 | h7b6447c_0 1.9 MB
cvxopt-1.2.0 | py36h9e0dedd_0 537 KB
glib-2.56.2 | hd408876_0 5.0 MB
python-3.6.8 | h0371630_0 34.4 MB
certifi-2018.11.29 | py36_0 146 KB
gsl-2.4 | h14c3975_4 2.6 MB
cryptography-2.4.2 | py36h1ba5d50_0 618 KB
libuuid-1.0.3 | h1bed415_2 16 KB
curl-7.63.0 | hbc83047_1000 145 KB
libgcc-ng-8.2.0 | hdf63c60_1 7.6 MB
fribidi-1.0.5 | h7b6447c_0 112 KB
ca-certificates-2018.12.5 | 0 123 KB
pango-1.42.3 | h8589676_0 522 KB
libpng-1.6.36 | hbc83047_0 346 KB
pycurl-7.43.0.2 | py36h1ba5d50_0 185 KB
tk-8.6.8 | hbc83047_0 3.1 MB
qt-5.9.7 | h5867ecd_1 85.9 MB
mkl-2018.0.3 | 1 198.7 MB
libcurl-7.63.0 | h20c2e04_1000 550 KB
metis-5.1.0 | hf484d3e_4 4.1 MB
fontconfig-2.13.0 | h9420a91_0 291 KB
matplotlib-3.0.2 | py36h5429711_0 6.5 MB
pillow-5.4.1 | py36h34e0f95_0 627 KB
------------------------------------------------------------
Total: 373.2 MB
The following NEW packages will be INSTALLED:
cvxopt: 1.2.0-py36h9e0dedd_0
fribidi: 1.0.5-h7b6447c_0
glpk: 4.65-h3ceedfd_2
gsl: 2.4-h14c3975_4
krb5: 1.16.1-h173b8e3_7
libuuid: 1.0.3-h1bed415_2
metis: 5.1.0-hf484d3e_4
suitesparse: 5.2.0-h171a5a3_0
tbb: 2018.0.5-h6bb024c_0
The following packages will be REMOVED:
anaconda: 5.2.0-py36_3
The following packages will be UPDATED:
ca-certificates: 2018.03.07-0 --> 2018.12.5-0
cairo: 1.14.12-h7636065_2 --> 1.14.12-h8948797_3
certifi: 2018.4.16-py36_0 --> 2018.11.29-py36_0
conda: 4.5.11-py36_0 --> 4.6.1-py36_0
cryptography: 2.2.2-py36h14c3975_0 --> 2.4.2-py36h1ba5d50_0
curl: 7.60.0-h84994c4_0 --> 7.63.0-hbc83047_1000
expat: 2.2.5-he0dffb1_0 --> 2.2.6-he6710b0_0
fontconfig: 2.12.6-h49f89f6_0 --> 2.13.0-h9420a91_0
freetype: 2.8-hab7d2ae_1 --> 2.9.1-h8a8886c_1
glib: 2.56.1-h000015b_0 --> 2.56.2-hd408876_0
harfbuzz: 1.7.6-h5f0a787_1 --> 1.8.8-hffaf4a1_0
libcurl: 7.60.0-h1ad7b7a_0 --> 7.63.0-h20c2e04_1000
libgcc-ng: 7.2.0-hdf63c60_3 --> 8.2.0-hdf63c60_1
libpng: 1.6.34-hb9fc6fc_0 --> 1.6.36-hbc83047_0
libssh2: 1.8.0-h9cfc8f7_4 --> 1.8.0-h1ba5d50_4
libstdcxx-ng: 7.2.0-hdf63c60_3 --> 8.2.0-hdf63c60_1
matplotlib: 2.2.2-py36h0e671d2_1 --> 3.0.2-py36h5429711_0
mkl: 2018.0.2-1 --> 2018.0.3-1
openssl: 1.0.2o-h20670df_0 --> 1.1.1a-h7b6447c_0
pango: 1.41.0-hd475d92_0 --> 1.42.3-h8589676_0
pillow: 5.1.0-py36h3deb7b8_0 --> 5.4.1-py36h34e0f95_0
pycurl: 7.43.0.1-py36hb7f436b_0 --> 7.43.0.2-py36h1ba5d50_0
python: 3.6.5-hc3d631a_2 --> 3.6.8-h0371630_0
qt: 5.9.5-h7e424d6_0 --> 5.9.7-h5867ecd_1
sqlite: 3.23.1-he433501_0 --> 3.26.0-h7b6447c_0
tk: 8.6.7-hc745277_3 --> 8.6.8-hbc83047_0
Proceed ([y]/n)? n
CondaSystemExit: Exiting.
The anaconda package is called a "meta-package" because it does not contain any code itself, but instead specifies dependencies of other packages that should be installed. The package cvoptx is not one of the packages specified by the anaconda package, so if you try to install cvoptx, there is a conflict that conda resolves by removing the anaconda package (since you give cvoptx higher priority by specifying as required to be installed in the environment).
conda and anaconda are separate, and have separate versions. conda is the command line interface that allows you to install, update, and remove packages and environments. anaconda is described above.
Finally (and confusingly), the anaconda command on the command line is provided by the anaconda-client package, not the anaconda package. If you want to see the version of Anaconda that is installed, use conda list anaconda. If you want the version of the anaconda-client command line tool, use anaconda --version. The anaconda-client is used to upload packages and environments to https://anaconda.org
The best way is to install it in a separate environment. It is recommended to have different environments for each project. I tend to avoid mixing project requirements together. For the project using cvxopt, I would do:
conda create --name cvx python=3.6
So here I create an environment called cvx that has Python 3.6
This will download all needed packages for Python36. Since it is a clean environment, there would be no upgrading or downgrading.
After that you can activate your environment as:
conda activate cvx
conda install -c conda-forge cvxopt
In these environment you have cvxopt. You can the build your project and run it in these environment. If you need extra packages, you can do:
conda install -n cvxopt PACKAGESNAME
Here is everything you need to know to work with environments https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
I installed pytorch but after that Spyder can no longer be launched. Here are the terminal info:
conda install pytorch torchvision -c pytorch Solving environment: done
==> WARNING: A newer version of conda exists. <== current version: 4.5.10 latest version: 4.5.11
Please update conda by running
$ conda update -n base -c defaults conda
Package Plan
environment location: /anaconda3/envs/base_py36
added / updated specs:
- pytorch
- torchvision
The following packages will be downloaded:
package | build
---------------------------|-----------------
torchvision-0.2.1 | py36_1 123 KB pytorch
scipy-1.1.0 | py36hf1f7d93_0 15.4 MB
scikit-learn-0.20.0 | py36h4f467ca_1 5.4 MB
numpy-base-1.15.2 | py36h8a80b8c_1 4.1 MB
numpy-1.11.3 | py36heee0a97_5 3.4 MB
ninja-1.8.2 | py36h04f5b5a_1 93 KB
pytorch-0.4.1 |py36_cuda0.0_cudnn0.0_1 10.0 MB pytorch
------------------------------------------------------------
Total: 38.5 MB
The following NEW packages will be INSTALLED:
ninja: 1.8.2-py36h04f5b5a_1
pytorch: 0.4.1-py36_cuda0.0_cudnn0.0_1 pytorch
torchvision: 0.2.1-py36_1 pytorch
The following packages will be REMOVED:
accelerate: 2.3.1-np111py36_0
The following packages will be UPDATED:
mkl: 11.3.3-0 --> 2019.0-118
numexpr: 2.6.7-py36hde7755b_0 --> 2.6.8-py36h1dc9127_0
numpy: 1.11.3-py36_nomklh8ecaf62_5 --> 1.11.3-py36heee0a97_5
numpy-base: 1.15.0-py36he97cb71_0 --> 1.15.2-py36h8a80b8c_1
scikit-learn: 0.19.1-py36_nomklhde7755b_0 --> 0.20.0-py36h4f467ca_1
scipy: 1.1.0-py36_nomklh7cd7d8e_0 --> 1.1.0-py36hf1f7d93_0
The following packages will be DOWNGRADED:
blas: 1.0-openblas --> 1.0-mkl
Proceed ([y]/n)? y
Downloading and Extracting Packages torchvision-0.2.1 | 123 KB |
############################### | 100% scipy-1.1.0 | 15.4 MB | ##################################### | 100% scikit-learn-0.20.0 | 5.4 MB |
############################### | 100% numpy-base-1.15.2 | 4.1 MB | ##################################### | 100% numpy-1.11.3 | 3.4 MB | ##################################### | 100%
ninja-1.8.2 | 93 KB |
############################### | 100% pytorch-0.4.1 | 10.0 MB | ##################################### | 100% Preparing transaction: done
I don't know if you have solved your issue, but in case you have and someone else comes across this question or you haven't and are still waiting:
I came across your post as a result of having the same thing happen to me...
It would seem that all I had to do was "conda update all" for it to start working again!
I came across it too. And I tried reopen Anaconda Navigator and it worked....