OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.5k stars 2.18k forks source link

Detection raises a ValueError #16

Closed mario-s closed 5 years ago

mario-s commented 6 years ago

Hi,

I'm trying to run the object detection on a Mac machine but getting an error. The libraries and their versions are up to date:

This is the stack trace: File "/usr/local/lib/python3.6/site-packages/imageai/Detection/init.py", line 121, in loadModel model = resnet50_retinanet(num_classes=80) File "/usr/local/lib/python3.6/site-packages/imageai/Detection/keras_retinanet/models/resnet.py", line 86, in resnet50_retinanet return resnet_retinanet(num_classes=num_classes, backbone='resnet50', inputs=inputs, kwargs) File "/usr/local/lib/python3.6/site-packages/imageai/Detection/keras_retinanet/models/resnet.py", line 69, in resnet_retinanet resnet = keras_resnet.models.ResNet50(inputs, include_top=False, freeze_bn=True) File "/usr/local/lib/python3.6/site-packages/imageai/Detection/keras_resnet/models/_2d.py", line 190, in ResNet50 return ResNet(inputs, blocks, numerical_names=numerical_names, block=keras_resnet.blocks.bottleneck_2d, include_top=include_top, classes=classes, args, kwargs) File "/usr/local/lib/python3.6/site-packages/imageai/Detection/keras_resnet/models/_2d.py", line 68, in ResNet x = keras_resnet.layers.BatchNormalization(axis=axis, epsilon=1e-5, freeze=freeze_bn, name="bn_conv1")(x) File "/usr/local/lib/python3.6/site-packages/keras/engine/topology.py", line 619, in call output = self.call(inputs, kwargs) File "/usr/local/lib/python3.6/site-packages/imageai/Detection/keras_resnet/layers/_batch_normalization.py", line 17, in call return super(BatchNormalization, self).call(training=(not self.freeze), args, kwargs) File "/usr/local/lib/python3.6/site-packages/keras/layers/normalization.py", line 176, in call return normalize_inference() File "/usr/local/lib/python3.6/site-packages/keras/layers/normalization.py", line 172, in normalize_inference epsilon=self.epsilon) File "/usr/local/lib/python3.6/site-packages/keras/backend/theano_backend.py", line 731, in batch_normalization x, gamma, beta, mean, var, reduction_axes, epsilon) File "/usr/local/lib/python3.6/site-packages/theano/tensor/nnet/bn.py", line 342, in batch_normalization_test raise ValueError("epsilon must be at least 1e-5, got %s" % str(epsilon)) ValueError: epsilon must be at least 1e-5, got 1e-05

Thanks for your help in advance!

OlafenwaMoses commented 5 years ago

Please uninstall the version of ImageAI that you have and install the latest version.