第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

我怎樣才能解決 not an sstable bad magic number 錯(cuò)誤

我怎樣才能解決 not an sstable bad magic number 錯(cuò)誤

MMTTMM 2023-03-08 14:56:44
我和我的朋友正在為黑客馬拉松制作圖像識(shí)別的深度學(xué)習(xí)模型,我們不斷遇到這個(gè)問(wèn)題?;旧?,當(dāng)我運(yùn)行 run.py 進(jìn)行分析和成像時(shí),它會(huì)返回 sstable(壞幻數(shù))錯(cuò)誤。我們不知道為什么會(huì)這樣,也不知道該怎么辦。這是 run.py:    import os, gcfrom skimage import ioimport globimport pandas as pdimport globimport tensorflow as tffrom tensorflow import kerasfrom keras.preprocessing import imagefrom tensorflow.keras.models import Sequential, save_model, load_modelimport matplotlib.pyplot as pltimport numpy as npfrom skimage import transformfrom keras.optimizers import Adamfrom keras.applications import mobilenet_v2from PIL import Imagepath = []for file in os.listdir("./media_cdn"):    path.append(file)print(path)filepath = './saved_model'model = load_model(filepath, custom_objects= None, compile = False)loss = 'CategoricalCrossentropy'optimizer = Adam(lr=1e-5)metrics = ['binary_accuracy']model.compile(optimizer=optimizer, loss=loss, metrics=metrics)def load(filename):np_image = Image.open("./media_cdn/" + filename)np_image = np.array(np_image).astype('float32')/255np_image = transform.resize(np_image, (244, 244, 3))np_image = np.expand_dims(np_image, axis=0)return np_imagenew_image = load(path[0])print(new_image.shape)new_model = keras.Sequential([model])new_model.load_weights('./model_weights')prediction = new_model.predict_classes(new_image)classes = np.argmax(prediction, axis = -1)print(classes)print('This is the Diagnosis:')if classes == 0:    print('MELANOMA')if classes == 1:    print('Melanocytic Nevus')if classes == 2:    print('Basal Cell Carcinoma')if classes == 3:    print('Arctinic Keratosis')if classes == 4:    print('Benign Keratosis')if classes == 5:    print('Dermatofibroma')if classes == 6:    print('Vascular Lesion')if classes == 7:    print('Squamous Cell Carcinoma')if classes == 8:    print(['Unknown', 'BCC', 'AK', 'BKL', 'DF', 'VASC', 'SCC', 'UNK'])classes = np.argmax(prediction, axis = 1)print(classes)調(diào)試時(shí),錯(cuò)誤顯示在行中l(wèi)oad_model。我們不知道如何修復(fù)它,歡迎任何幫助。
查看完整描述

1 回答

?
慕絲7291255

TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個(gè)贊

好的,我知道為什么會(huì)發(fā)生這種情況。看來(lái)我必須在我的計(jì)算機(jī)上運(yùn)行該模型,以便它可以生成正確的變量和模型文件。



查看完整回答
反對(duì) 回復(fù) 2023-03-08
  • 1 回答
  • 0 關(guān)注
  • 347 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)