how to install tensorflow on anaconda python 3.6

前端 未结 12 1950
滥情空心
滥情空心 2020-11-29 21:38

I installed the new version python 3.6 with the anaconda package. However i am not able to install tensorflow. Always receive the error that

tensorflow_gpu-1.0.0rc2

12条回答
  •  庸人自扰
    2020-11-29 22:06

    I will simply leave this here because none of the other approaches worked for me. Also, I can look it up myself when I need it for new devices.

    THIS IS THE WAY IT WORKS:

    1. Install Anaconda
    2. Open Anaconda Prompt
    3. conda create --name tensorflow
    4. conda activate tensorflow
    5. Search with conda search tensorflow for all available TensorFlow versions
    6. Choose the one you need (usually the newest one)
    7. Explicitly name the version now (otherwise it happened to me that version 1.14 was installed): conda install -c conda-forge tensorflow=YOUR_VERSION
    8. Open Anaconda, choose the new environment and install Spyder
    9. Install Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
    10. Download msvcp140.dll and add the .dll-File to the Windows\System32 folder

    Now it should work like a charm!

    TROUBLESHOOTING:

    If it still doesn't work, try this, it worked for me:

    Open Anaconda-Prompt:

    1. Create an environment with Python 3.6 like this: conda create --name tensorflow_env python=3.6
    2. conda activate tensorflow
    3. Steps 6. and 6. from the list above
    4. conda install tensorflow=YOUR_VERSION(not forge, just like this!)
    5. Now do steps 8, 9, 10 from above

    TENSORFLOW GPU:

    If you want to use your GPU, do it the same way as described above, with the only difference to install tensorflow-gpu instead if tensorflow.

    And, you must install the newest NVIDIA driver for your GPU, you can find and choose the right one here.

    (Yes, in TF 2 there's both, a CPU and GPU support, in the "normal" library. However, if you install tensorflow-gpu via conda, it installs the CUDA and cudNN etc. you need automatically for you - also the right versions. This way easier and faster.)

提交回复
热议问题