Error while import tensorflow module

后端 未结 6 1143
清酒与你
清酒与你 2020-12-02 01:04

I try to learn TensorFlow with Python. My problem is with import TF module. Here is my configuration: Python 3.6.1, Windows 7 (with MSVCP14

相关标签:
6条回答
  • 2020-12-02 01:34

    This is a known error. There is a file named MSVCP140.DLL, that you will need in your system to run TensorFlow. Check if this file is in your %path%. If it is not, download Visual Studio C++. It is free and you can download it here: https://www.visualstudio.com/vs/cplusplus.

    0 讨论(0)
  • 2020-12-02 01:35

    Solution:-

    Don't suffer a lot. Simply downgrade your python version from 3.6.1 to 3.5.2 and

    install tensorflow again.. you need not to upgrade the package.

    "pip install tensorflow" will automatically download latest version (probably

    1.0.1)

    Steps:-

    Step 1:- conda search python

    Step 2:- conda install python=3.5.2

    Step 3:- pip install tensorflow

    Step 4:- import tensorflow as tf

    Horray!!.. It works..

    Hope you may not get the same error again!!

    0 讨论(0)
  • 2020-12-02 01:36

    If you have a GPU in your system and it is conflicting with the current set of libraries or throwing a cudnn error then you can add the following line in your code to disable the GPU

    os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
    

    put this in your code and it should be fine.

    0 讨论(0)
  • 2020-12-02 01:44

    At first, I used an anaconda environment with Python 3.5 and PIP version 19 but had the same problem. so instead of PIP, I used Conda package manager:

    conda install TensorFlow
    

    it worked well after using Conda instead of PIP

    0 讨论(0)
  • 2020-12-02 01:47

    Solution is downgrade Python to version 3.5, and install again TensorFlow. It works for me

    0 讨论(0)
  • 2020-12-02 01:53

    The problem was the cuDNN Library for me - for whatever reason cudnn-8.0-windows10-x64-v6.0 was NOT working - I used cudnn-8.0-windows10-x64-v5.1 - ALL GOOD!

    My setup working with Win10 64 and the Nvidia GTX780M:

    • Be sure you have the lib MSVCP140.DLL by checking your system/path - if not get it here
    • Run the windows installer for python 3.5.3-amd64 from here - DO NOT try newer versions as they probably won't work
    • Get the cuDNN v5.1 for CUDA 8.0 from here - put it under your users folder or in another known location (you will need this in your path)
    • Get CUDA 8.0 x86_64 from here
    • Set PATH vars as expected to point at the cuDNN libs and python (the python path should be added during the python install)

    If you run Windows 32 be sure to get the 32 bit versions of the files mentioned above.

    0 讨论(0)
提交回复
热议问题