简体   繁体   中英

Tensorflow GPU Usage

So I'm trying to train my first image classifier in Keras, and it's running at a crawl with a training set of 8000 images. During training my cpu / gpu are at around 40% / 3% usage and I'm not at all convinced tensorflow-gpu is installed correctly as I'm not getting the "successfully opened CUDA library" lines I'm supposedly supposed to see when importing it.

My questions are:

  1. How long should something of this size typically take to train on a 1080, and

  2. Given that I've installed the following, what could I be missing while trying to set up tensorflow-gpu?

    • Fresh Windows 10 install
    • Latest 64 bit Anaconda
    • Visual Studio 2017 w/ only "Desktop Development with C++" box checked on install
    • Cuda Toolkit 9.0 with latest patch
    • cuDNN v7.0.5 (Dec 5, 2017), for CUDA 9.0
    • tensorflow-gpu 1.7
    • Screenshot of environment variables

在此处输入图片说明

One way(and the best for me) of checking if your tf uses GPU is with nvidia-smi :here you see the GPU Memory Usage for my task(I have 1.6 mil of observations with 13 variables and takes ~11 GB, your's should take couple mb or GB as well(don't know how looks your pictures)) so if your system won't show this info once you start running your model than for sure is using CPU (GPU couple mins to couple hours but CPU will take longer)

nvidia-smi信息

Note: My terminal won't output the tensorflow output stuff, that is present in IDE as follow (CUDA doesn't show there as is claimed online, that cuda issue was only when is incompatibility and can't start the GPU in tf):

Tensorflow使用GPU

Here is the info that the test passed once the cudnn is installed correctly:

库丁测试合格

PS: Hope it helps. Tried yesterday Tensorflow 1.7 version in ubuntu and didn't work as expected (the GPU didn't work so downgraded back to 1.6 ) so would suggest you to use the 1.6: 检查TF版本

For your setup is a bit different than the official docs:

nvidia cuda toolkit documentation

So here is the correct path:

Ensure the following values are set:

Variable Name: CUDA_PATH 
Variable Value: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0

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