logo
Loading...

載入.h5檔出現ValueError: You are trying to load a weight file containing 16 layers into a model with 0 layers錯誤 - Cupoy

Hi我根據講義的連結https://ithelp.ithome.com.tw/articles/10...

ml100-3,ml100-3-d100

載入.h5檔出現ValueError: You are trying to load a weight file containing 16 layers into a model with 0 layers錯誤

2019/12/24 10:06 上午
機器學習共學討論版
David Teng
觀看數:3
回答數:3
收藏數:0
ml100-3
ml100-3-d100

Hi

我根據講義的連結

https://ithelp.ithome.com.tw/articles/10190971

按照裡面的步驟進行transfer learning, 使用 VGG16 這個 model

然後搭配期末考的花朵辨識資料進行訓練 

最後存出 .h5檔 flower-model-base-VGG16.h5


然後開新.py檔案載入這個 .h5檔

model = load_model('flower-model-base-VGG16.h5')


卻會回傳

ValueError: You are trying to load a weight file containing 16 layers into a model with 0 layers


請問這個該怎麼解決呢?