ModuleNotFoundError:没有名为“tensorflow.python.keras.applications.MobileNetV2”的模块

uinbv5nw  于 2023-06-23  发布在  Python
关注(0)|答案(3)|浏览(167)

我正在尝试导入
import tensorflow.python.keras.applications.MobileNetV2
但它给出了下面的错误:
ModuleNotFoundError:没有名为“tensorflow.python.keras.applications.MobileNetV2”的模块
我的tensorflow版本是1.8.0,keras版本是2.2.0

gywdnpxw

gywdnpxw1#

使用此命令导入网络并构建网络:

from keras import applications
net = applications.MobileNetV2(*proper arguments here*)
zzoitvuj

zzoitvuj2#

使用这个:

from keras.applications import MobileNetV2
model = MobileNetV2(include_top=False, input_shape=(224, 224, 3),weights="imagenet")
# input_shape=(height, width, color_mode)
w3nuxt5m

w3nuxt5m3#

请尝试使用以下命令:从tensorflow.keras.applications.mobilenet_v2导入preprocess_input

相关问题