[英]How to make Prediction with Keras
我是 python 和 ML 的新手。 當前嘗試使用 Keras 嘗試導入decode_predictions
和preprocess_input
時出現導入錯誤。 更重要的是,當嘗試將get_default_graph
用於inception_model
時,我得到Attribute Error
。 一切似乎都在正在使用的視頻教程中工作。
import numpy as np
import tensorflow as tf
import keras
from keras.preprocessing.image import img_to_array, load_img
from keras.applications import inception_resnet_v2 as InceptionResNetV2,decode_predictions, preprocess_input
from tensorflow.keras.models import Sequential
from IPython.core.display import display
inception_model.graph= tf.get_default_graph()
關於導入,使用以下命令:
from keras.applications.inception_resnet_v2 import (decode_predictions,
preprocess_input,
InceptionResNetV2)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.