小编use*_*158的帖子

TensorFlow似乎不使用GPU

TensorFlow在Windows 8和Python 3.5上使用.我改变了这个简短的例子来看看,如果GPU支持(Titan X)工作.不幸的是运行时用(tf.device("/gpu:0")和没有(tf.device("/cpu:0"))使用GPU是相同的.Windows CPU监视显示,在两种情况下,CPU负载在计算期间约为100%.

这是代码示例:

import numpy as np
import tensorflow as tf
import datetime

#num of multiplications to perform
n = 100

# Create random large matrix
matrix_size = 1e3
A = np.random.rand(matrix_size, matrix_size).astype('float32')
B = np.random.rand(matrix_size, matrix_size).astype('float32')

# Creates a graph to store results
c1 = []

# Define matrix power
def matpow(M, n):
    if n < 1: #Abstract cases where n < 1
        return M
    else: …
Run Code Online (Sandbox Code Playgroud)

python gpu python-3.5 tensorflow

6
推荐指数
1
解决办法
6174
查看次数

标签 统计

gpu ×1

python ×1

python-3.5 ×1

tensorflow ×1