登录  /  注册
python - tensorflow 在windows 下怎么使用gpu ?
迷茫
迷茫 2017-04-18 10:12:20
[Python讨论组]
  1. 相关环境

  • windows 10

  • python 3.5.2

  • tensorflow-gpu (0.12.1)

  • N卡960M

  • 核显 Intel HD Graphics 4600

  1. 代码

import tensorflow as tf

with tf.Session() as sess:
  with tf.device("/gpu:0"):
    matrix1 = tf.constant([[3., 3.]])
    matrix2 = tf.constant([[2.],[2.]])
    product = tf.matmul(matrix1, matrix2)
    result = sess.run([product])
    print(result)
  1. 错误信息

InvalidArgumentError (see above for traceback): Cannot assign a device to node 'MatMul': Could not satisfy explicit device specification '/device:GPU:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0
         [[Node: MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/device:GPU:0"](Const, Const_1)]]

2017-01-08 tensorflow 在windows 下使用gpu中文教程

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2024 //m.sbmmt.com/ All Rights Reserved | php.cn | 湘ICP备2023035733号