首页 > 其他分享 >tflearn alexnet iter 10

tflearn alexnet iter 10

时间:2023-05-30 22:04:35浏览次数:44  
标签:10 network conv activation iter 2d tflearn import alexnet

他会自己下载数据:

 

# -*- coding: utf-8 -*-

""" AlexNet.
Applying 'Alexnet' to Oxford's 17 Category Flower Dataset classification task.
References:
    - Alex Krizhevsky, Ilya Sutskever & Geoffrey E. Hinton. ImageNet
    Classification with Deep Convolutional Neural Networks. NIPS, 2012.
    - 17 Category Flower Dataset. Maria-Elena Nilsback and Andrew Zisserman.
Links:
    - [AlexNet Paper](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf)
    - [Flower Dataset (17)](http://www.robots.ox.ac.uk/~vgg/data/flowers/17/)
"""

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))

# 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='relu')
network = max_pool_2d(network, 3, strides=2)
network = local_response_normalization(network)
network = conv_2d(network, 384, 3, activation='relu')
network = conv_2d(network, 384, 3, activation='relu')
network = conv_2d(network, 256, 3, activation='relu')
network = max_pool_2d(network, 3, strides=2)
network = local_response_normalization(network)
network = fully_connected(network, 4096, activation='tanh')
network = dropout(network, 0.5)
network = fully_connected(network, 4096, activation='tanh')
network = dropout(network, 0.5)
network = fully_connected(network, 17, activation='softmax')
network = regression(network, optimizer='momentum',
                     loss='categorical_crossentropy',
                     learning_rate=0.001)

# Training
model = tflearn.DNN(network, checkpoint_path='model_alexnet',
                    max_checkpoints=1, tensorboard_verbose=2)
#model.fit(X, Y, n_epoch=1000, validation_set=0.1, shuffle=True,
model.fit(X, Y, n_epoch=10, validation_set=0.1, shuffle=True,
          show_metric=True, batch_size=64, snapshot_step=200,
snapshot_epoch=False, run_id='alexnet_oxflowers17')
model.save('flower-classifier')

tflearn alexnet iter 10_2d


打开tensotboard: tensorboard --logdir=/tmp/tflearn_logs/


通过tensorboard查看准确率变化以及loss变化,上图是跑了10个epoch的结果。

标签:10,network,conv,activation,iter,2d,tflearn,import,alexnet
From: https://blog.51cto.com/u_11908275/6382284

相关文章

  • tflearn Training Step每次 We will run it for 10 epochs (t
    TrainingTFLearnprovidesamodelwrapper'DNN'thatcanautomaticallyperformsaneuralnetworkclassifiertasks,suchastraining,prediction,save/restore,etc...Wewillrunitfor10epochs(thenetworkwillseealldata10times)withabat......
  • 华纳娱乐公司在线客服电话18488108816(微信同步)
    华纳娱乐公司在线客服电话18488108816(微信同步)华纳娱乐公司在线客服电话18488108816(微信同步)华纳娱乐公司在线客服电话18488108816(微信同步)华纳娱乐公司在线客服电话18488108816(微信同步)华纳娱乐公司在线客服电话18488108816(微信同步)华纳娱乐公司在线客服电话18488108816(微信同步)......
  • Ubuntu 23.10 将改进 PPA 管理以提高安全性
    近日消息,Canonical致力于在未来的Ubuntu版本中实施一种管理PPA档案的新方法。Canonical宣布,他们一直在研究如何在即将发布的Ubuntu23.10(ManticMinotaur)版本中管理PPA(IT之家注:个人软件包档案,PersonalPackageArchives)的新方法。Ubuntu23.10开发于2023......
  • Ubuntu 23.10 将改进 PPA 管理以提高安全性
    近日消息,Canonical致力于在未来的Ubuntu版本中实施一种管理PPA档案的新方法。Canonical宣布,他们一直在研究如何在即将发布的Ubuntu23.10(ManticMinotaur)版本中管理PPA(IT之家注:个人软件包档案,PersonalPackageArchives)的新方法。Ubuntu23.10开发于2023......
  • Ubuntu 23.10 将改进 PPA 管理以提高安全性
    近日消息,Canonical致力于在未来的Ubuntu版本中实施一种管理PPA档案的新方法。Canonical宣布,他们一直在研究如何在即将发布的Ubuntu23.10(ManticMinotaur)版本中管理PPA(IT之家注:个人软件包档案,PersonalPackageArchives)的新方法。Ubuntu23.10开发于2023......
  • 银河麒麟V10安装Lazarus
    银河麒麟V10软件商店中的lazarus安装报错#0002,只能自己手动安装。安装lazarus需要使用安装工具fpcupdeluxe:https://wiki.freepascal.org/fpcupdeluxe依照上面链接的用apt-get安装MissingPackages时,会出错卡在libicu66包的安装,无法继续。 1.安装aptitudesudoapt-getinsta......
  • Qemu仿真----(10)运行ArchLinux Rootfs
    平台:ubuntu-22.04-desktop-amd64.对象:archlinuxrootfs、qemu.文件:linux-6.1.26.tar.xz、ArchLinuxARM-2023.03-aarch64-rootfs.tar.gz.本例通过qemu运行archlinuxrootfsforarm64。1.安装依赖$sudoaptinstallqemu-system-aarch64gcc-aarch64-linux-gnu2.下载文件......
  • mysql8和pgsql10你选哪个?
    手里有个云服务器1核1G,ubuntu20.04,经常用来测试一些开源应用。刚好有个应用需要数据库支持,或者mysql8,或者pgsql10。显然mysql用起来更得心应手,可是安装不上mysql8,显然内存不够,无奈只好试下pgsql,安装竟然非常顺畅。安装了pgsql12,目前占用内存也就130M左右起了一个应用,统计一下......
  • 中兴新支点系统离线安装ceph 16.2.10
    微信公众号:运维开发故事,作者:wanger关于中兴新支点系统中兴新支点操作系统基于Linux稳定内核,分为嵌入式操作系统(NewStartCGEL)、服务器操作系统(NewStartCGSL)、桌面操作系统(NewStartNSDL),经过近10年专业研发团队的积累和发展,产品形成安全加固、自主可控、易用管理的突出优势。目前,......
  • Pytest - Fixture(10) - 测试用例传参给Fixture
    Pytest-测试用例传参给Fixture大多数时候我们在fixture封装的是登陆、获取cookie等操作,但是一个系统可能不止一个用户,有多个用户;在写测试用例的时候,如何告诉fixture我们需要登录哪个用户?可以通过测试用例给fixture传递参数,指定登陆用户账户信息。传单个参数fi......