简体   繁体   中英

installing Tensorflow with pip

I have installed tensorflow with pip

pip3 install --upgrade tensorflow-gpu

Then when I'm in python and I try to

import tensorflow

I get this error. https://i.gyazo.com/0a66a7ceef62a8de55a4d59c58e57388.png

I have the latest version of python and windows 10 x64

The errors that you got in the screenshot start with DLL Load failed - and I notice that you installed with pip3 and that you installed on windows installing for GPU use. This guide starts with a prerequisites that you may have ignored:

Installing TensorFlow on Windows

This guide explains how to install TensorFlow on Windows.

Determine which TensorFlow to install

You must choose one of the following types of TensorFlow to install:

TensorFlow with CPU support only. If your system does not have a NVIDIA® GPU, you must install this version. Note that this version of TensorFlow is typically much easier to install (typically, in 5 or 10 minutes), so even if you have an NVIDIA GPU, we recommend installing this version first.

TensorFlow with GPU support. TensorFlow programs typically run significantly faster on a GPU than on a CPU. Therefore, if your system has a NVIDIA® GPU meeting the prerequisites shown below and you need to run performance-critical applications, you should ultimately install this version.

Requirements to run TensorFlow with GPU support

If you are installing TensorFlow with GPU support using one of the mechanisms described in this guide, then the following NVIDIA software must be installed on your system:

CUDA® Toolkit 8.0. For details, see NVIDIA's documentation Ensure that you append the relevant Cuda pathnames to the %PATH% environment variable as described in the NVIDIA documentation. The NVIDIA drivers associated with CUDA Toolkit 8.0. cuDNN v5.1. For details, see NVIDIA's documentation. Note that cuDNN is typically installed in a different location from the other CUDA DLLs. Ensure that you add the directory where you installed the cuDNN DLL to your %PATH% environment variable . GPU card with CUDA Compute Capability 3.0 or higher. See NVIDIA documentation for a list of supported GPU cards. If you have an earlier version of the preceding packages, please upgrade to the specified versions.

The above from the linked page but with my highlighting added, (and other styling lost).

You also need to ensure that you have a compatible graphics card fitted to the machine. If you are in any doubt try:

pip3 install --upgrade  tensorflow

You will get the CPU based version of tensorflow which does not require external software be installed & on the path but will run slower.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM