#硬件配置
*本人用的是 lenovo小新锐7000笔记本,cpu是intel -core -i5-7300Q
四核,内存4G,机械硬盘320G,双显卡,集成intel® HD Graphics630
独显 GeForce GTX 1050,这块显卡位宽128bit, 显存2G,有640个cuda核心。
##系统环境:
win7下,安装Anaconda3, 之后安装Python3.6 , Cuda9.0,cudnn9.0 tensorflow1.14.0, Pycharm专业版 ,训练该数据集用了两层的卷积神经网络,训练2万步,在不开启GPU加速的情况下用时59分06秒;切换到GPU虚拟环境下用时5分12秒。看来没有GPU,实践深度学习确实有难度呀。
附代码如下:
*
//import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
def conv2d(x, W):
return tf.nn.conv2d(x, W, strides=[1, 1, 1, 1], padding='SAME')
def max_pool_2x2(x):
return tf.nn.max_pool(x, ksize=[1, 2, 2