問題描述
到目前為止,我一直在使用 Tensorflow-GPU,通過 pip 以及 Nvidia 網站上的 Cuda 相關軟件和 Nvidia 軟件/驅動程序安裝它強>.最近發現使用conda install tensorflow-gpu
也安裝了cudatoolkit和cudnn.
Till date, I have been using Tensorflow-GPU by installing it using pip and the Cuda related software and Nvidia softwares/drivers from Nvidia's website. Recently, I found that using conda install tensorflow-gpu
also installs cudatoolkit and cudnn.
那么,這些(conda 提供的)與我從 Nvidia 網站下載的有什么不同?
So, how are these(the ones provided by conda) different from the ones that I downloaded from Nvidia's website?
在我的第一個(以前的)環境中,conda list
顯示我只安裝了 TensorFlow(來自 PyPi),沒有安裝 cudnn/cudatoolkit,但一切正常.
In my first (previous) environment, conda list
showed that I have installed only TensorFlow(from PyPi) and no cudnn/cudatoolkit, but still everything worked.
另外,在我運行 conda install tensorflow-gpu
的新環境中,conda list
顯示 tensorflow-gpu 已安裝以及 Anaconda 的 cudatoolkit 和 cudnn.在這種環境下,一切正常.
Also, in a new environment in which I ran conda install tensorflow-gpu
, conda list
showed me tensorflow-gpu has been installed along with cudatoolkit and cudnn by Anaconda. And in this environment also, everything worked fine.
這是否意味著,如果我使用 pip 安裝 TensorFlow,則僅需要從 Nvidia 網站下載和安裝 Cuda?
So does this mean, that downloading and installing Cuda from Nvidia's website is only necessary if I use pip to install TensorFlow?
推薦答案
如果使用 anaconda 安裝 tensorflow-gpu,是的,它會在與 tensorflow-gpu 相同的 conda 環境中為您安裝 cuda 和 cudnn.您只需要自己安裝最新的 nvidia 驅動程序(以便它適用于最新的 CUDA 級別和您使用的所有舊 CUDA 級別.)
If using anaconda to install tensorflow-gpu, yes it will install cuda and cudnn for you in same conda environment as tensorflow-gpu. All you need to install yourself is the latest nvidia-driver (so that it works with the latest CUDA level and all older CUDA levels you use.)
這比 pip install tensorflow-gpu 方法有很多優點:
This has many advantages over the pip install tensorflow-gpu method:
- Anaconda 將始終安裝 TensorFlow 代碼編譯后使用的 CUDA 和 CuDNN 版本.
- 您可以擁有多個具有不同級別 TensorFlow、CUDA 和 CuDNN 的 conda 環境,只需使用 conda activate 在它們之間切換.
- 您不必在系統級別手動安裝 CUDA 和 cuDNN.
與 pip install tensorflow-gpu 相比的缺點是,在 Anaconda 能夠更新 conda 配方并發布其最新 TensorFlow 版本的構建之前幾周,最新版本的 tensorflow 被添加到 pypi.
The disadvantage when compared to pip install tensorflow-gpu, is the latest version of tensorflow is added to pypi weeks before Anaconda is able to update the conda recipe and publish their builds of the latest TensorFlow version.
這篇關于Nvidia Cudatoolkit 與 Conda Cudatoolkit的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!