簡體   English   中英

為什么加載重量時出現此錯誤?

[英]Why am I getting this error when loading weights?

# Load the hdf5 files
resnet50 = h5py.File('/content/RestNet 50 best_model.hdf5', 'r')
ourmodel = h5py.File('/content/best_model.hdf5', 'r')
resnet152 = h5py.File('/content/best_model_4.hdf5', 'r')

# Get the predictions from each model
predictions1 = resnet50.predict(images)
predictions2 = ourmodel.predict(images)
predictions3 = resnet152.predict(images)

# Combine the predictions using a majority vote
predictions = np.array([predictions1, predictions2, predictions3])
predictions = np.mean(predictions, axis=0)
print(predictions)

錯誤是

OSError:無法打開文件(截斷文件:eof = 225443840,sblock->base_addr = 0,stored_eof = 245806944)

OSError:無法打開文件(截斷文件:eof = 225443840,sblock->base_addr = 0,stored_eof = 245806944)

這意味着您的文件已損壞。 預計為 245806944 字節,但在讀取 225443840 字節后就結束了。 唯一的選擇是重新下載它或找到一個未損壞的文件。 這種情況經常發生,如果你的連接在下載時中斷或者你自己訓練它,你的進程在它完成將文件寫入磁盤之前就停止了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM