"Ubuntu-tensorflow" invalidargumenterror a problem that the GPU cannot use _gpu

Source: Internet
Author: User

The questions are as follows:

Invalidargumenterror (above for traceback): Cannot assign a device to node ' train/final/fc3/b/momentum ': Could not sat ISFY explicit device specification '/device:gpu:0 ' because no devices matching that specification are registered in this P rocess; Available devices:/job:localhost/replica:0/task:0/cpu:0
colocation Debug Info:
colocation Group had the Following types and devices: Applymomentum:cpu mul:cpu sum:cpu abs:cpu const:cpu Assign 
: CPU 
identity:cpu 
variablev2:cpu 
     [[node:train/final/fc3/b/momentum = variablev2[_class=[' loc: @train/ Final/fc3/b "], container=" ", Dtype=dt_float, shape=[29], shared_name=" ", _device="/device:gpu:0 "] [)]]

Problem reason: some TF. Variable () is not allowed to run on the GPU and needs to run on the CPU
Solution: Modify the configuration inside the allow_soft_placement=true, and Allow_soft_placement=true, is running in the presence of the GPU is not allowed to run, you can switch to the CPU.

2017/8/9 20:20
After an afternoon of continuous debugging certification, found that allow_soft_placement=true, is in the GPU running program, automatically switch to the CPU, this way although to ensure the normal operation of the program, However, it is not guaranteed that the GPU problems can be timely feedback, so it is recommended to use the Allow_soft_placement=true option.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.