cifar10数据集,n_epoch=50,batch_size=96
笔记本i5,8G,GeForce 920MX
此次试验,可能最大的收获就是,TensorFlow-gpu用起来了,但加速效果,实在不敢奢望,5733.593992 s,可能只有cpu的两倍速度。
同样的数据集,同样的代码,在阿里云的GPU单卡加速,可以做到十几分钟。
使用tflearn可以自行判断有没有gpu加速,不需要with tf.device('/gpu:0')
2018-05-19 19:39:51.154234: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-05-19 19:39:52.341156: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties:
name: GeForce 920MX major: 5 minor: 0 memoryClockRate(GHz): 0.993
pciBusID: 0000:01:00.0
totalMemory: 2.00GiB freeMemory: 1.66GiB
2018-05-19 19:39:52.341974: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0
2018-05-19 19:42:22.866390: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-05-19 19:42:22.866619: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929] 0
2018-05-19 19:42:22.866767: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0: N
2018-05-19 19:42:22.868412: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1433 MB memory) -> physical GPU (device: 0, name: GeForce 920MX, pci bus id: 0000:01:00.0, compute capability: 5.0)
2018-05-19 19:42:23.699940: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0
2018-05-19 19:42:23.700157: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-05-19 19:42:23.700358: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929] 0
2018-05-19 19:42:23.700489: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0: N
2018-05-19 19:42:23.700684: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1433 MB memory) -> physical GPU (device: 0, name: GeForce 920MX, pci bus id: 0000:01:00.0, compute capability: 5.0)