[英]How to make Prediction with Keras
I am new to python and ML.我是 python 和 ML 的新手。 Currently trying to use Keras I get import error when trying to import decode_predictions
and preprocess_input
.当前尝试使用 Keras 尝试导入decode_predictions
和preprocess_input
时出现导入错误。 More so when trying to use get_default_graph
for inception_model
I get Attribute Error
.更重要的是,当尝试将get_default_graph
用于inception_model
时,我得到Attribute Error
。 Everything seems to be working in the video tutorial am using.一切似乎都在正在使用的视频教程中工作。
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()
Regarding the import, use the following command:关于导入,使用以下命令:
from keras.applications.inception_resnet_v2 import (decode_predictions,
preprocess_input,
InceptionResNetV2)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.