分享

使用TensorFlow实现CNN(卷积神经网络)

Oner 2018-3-26 21:13:12 发表于 功能源码 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 5071
功能点

TensorFlow实现CNN(卷积神经网络)

运行环境

Python 2.7
Jupyter Notebook 4.3.0

代码预览

[mw_shl_code=python,true]import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data

# one_hot=True 目的是将 label 进行 one-hot 编码
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)

config = tf.ConfigProto(allow_soft_placement=True)
#最多占gpu资源的70%
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.7)
#开始不会给tensorflow全部gpu资源 而是按需增加
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)[/mw_shl_code]

代码下载

03. CNN(Convolutional Neural Network).zip (19.21 KB, 下载次数: 5)

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条