Closed dongyang2333 closed 1 year ago
me too
i got request url error
If you look at the error message, you'll see it's interpreting mobilenet_v2_140_224/saved_model.h5
as a directory entry, and looking for either a file named saved_model.pbtxt
or a file named saved_model.pb
within that directory. You need to change the string to just the directory name, which should just be mobilenet_v2_140_224
like this:
from tensorflow.keras.models import load_model
savedModel = load_model(
'mobilenet_v2_140_224', custom_objects={"kerasLayer": tensorflow_hub.KerasLayer}
)
If this is still a problem, please provide the version of nsfw_detector that you're using, your Python version, your Python platform, and a code example of how you're invoking nsfw_detector, and reopen the issue.
rovide the version of n
Have you solved this problem yet?
I tried load model use this code. from tensorflow.keras.models import load_model savedModel = load_model( 'mobilenet_v2_140_224 /saved_model.h5', custom_objects={"kerasLayer": tensorflow_hub.KerasLayer} ) #model 2 I got this error OSError: SavedModel file does not exist at: /mobilenet_v2_140_224/saved_model.h5/{saved_model.pbtxt|saved_model.pb}.