资源简介
使用tflearn高层封装,用alexnet对鲜花数据集进行训练
代码片段和文件信息
from __future__ import division print_function absolute_import
import tflearn
from tflearn.layers.core import input_data dropout fully_connected
from tflearn.layers.conv import conv_2d max_pool_2d
from tflearn.layers.normalization import local_response_normalization
from tflearn.layers.estimator import regression
import tflearn.datasets.oxflower17 as oxflower17
X Y = oxflower17.load_data(one_hot=True resize_pics=(227 227)) ##此句调用了tflearn文件夹下dataset中oxflower17.py函数,
##此函数主要作用是下载Oxfords数据
# Building ‘AlexNet‘
network = input_data(shape=[None 227 227 3])
network = conv_2d(network 96 11 strides=4 activation=‘relu‘)
network = max_pool_2d(network 3 strides=2)
network = local_response_normalization(network)
network = conv_2d(network 256 5 activation=‘rel
评论
共有 条评论