【发布时间】:2020-10-30 21:23:32
【问题描述】:
我是 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()
【问题讨论】:
-
你好@Hoc,欢迎来到 SO。请提供
inception_model初始化的代码,以使此案例可重现。
标签: python tensorflow keras google-colaboratory