MobileNetV3
MobileNetV3 copied to clipboard
Hi,
I tried Image classification using MobilenetV3 both small & large. How to do inference on test image. I am getting error saying "ValueError: Unknown activation function:_hard_swish"
you have to redefine the custom objects like hard_wish in your inference script and pass them to the load_model function
hi, did you solve this problem? i am still getting an error "TypeError: _hard_swish() missing 1 required positional argument: 'x'" when i pass the custom objects to the load_model function. Thanks.
Yes, this is what I did..
def relu6(x):
"""Relu 6
"""
return K.relu(x, max_value=6.0)
def hard_swish(x):
"""Hard swish
"""
return x * K.relu(x + 3.0, max_value=6.0) / 6.0
dependencies = {'_hard_swish': hard_swish,'_relu6': relu6}
model = load_model(model_path, custom_objects=dependencies)
Thanks a million!!!