-
大小: 3KB文件類型: .zip金幣: 1下載: 0 次發布日期: 2021-01-01
- 語言: Python
- 標簽: keras??遷移學習??Inception-v3??caltech256??
資源簡介
使用keras框架,對Inception-v3模型進行遷移學習,處理caltech256數據集的圖像分類問題,現附上可執行代碼,與大家分享。數據需要自己進行預處理,分為訓練集和驗證集。迭代次數都需要自行設定。提供train learning 和fun tune兩種方法。
代碼片段和文件信息
#zhouaolong2017@gmail.com
#歡迎交流
#基于inception-v3做遷移學習
from?keras.preprocessing.image?import?ImageDataGenerator
from?keras.applications.inception_v3?import?InceptionV3preprocess_input
from?keras.layers?import?GlobalAveragePooling2DDense
from?keras.models?import?Model
from?keras.utils.vis_utils?import?plot_model
from?keras.optimizers?import?Adagrad?SGD
#準備數據?prepare?data
train_datagen?=?ImageDataGenerator(
preprocessing_function?=?preprocess_input
rotation_range?=?30
width_shift_range?=?0.2
height_shift_range?=?0.2
shear_range?=?0.2
zoom_range?=?0.2
horizontal_flip?=?True
)
test_datagen?=?ImageDataGenerator(
preprocessing_function=preprocess_input
rotation_range=30
width_shift_range=0.2
height_shift_range=0.2
shear_range=0.2
zoom_range=0.2
horizontal_flip=True
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????3253??2018-10-26?09:33??cnn_classification.py
- 上一篇:二維碼批量識別解碼python腳本
- 下一篇:隨機森林的Python代碼實現
評論
共有 條評論