简体   繁体   中英

ModuleNotFoundError: No module named 'tensorflow.python.keras.applications.MobileNetV2'

I am trying to import

import tensorflow.python.keras.applications.MobileNetV2

but it gives the bellow error:

ModuleNotFoundError: No module named 'tensorflow.python.keras.applications.MobileNetV2'

my tensorflow version is 1.8.0 and keras version is 2.2.0

Use this to import a net and build it:

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

use this:

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

Try using the following: from tensorflow.keras.applications.mobilenet_v2 import preprocess_input

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM