I'm trying to convert saved YOLOv2 model(.h5) to coreml, but it fails.
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_1 (InputLayer) (None, 416, 416, 3) 0
_________________________________________________________________
conv2d_1 (Conv2D) (None, 416, 416, 16) 432
_________________________________________________________________
batch_normalization_1 (Batch (None, 416, 416, 16) 64
_________________________________________________________________
leaky_re_lu_1 (LeakyReLU) (None, 416, 416, 16) 0
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 208, 208, 16) 0
_________________________________________________________________
conv2d_2 (Conv2D) (None, 208, 208, 32) 4608
_________________________________________________________________
batch_normalization_2 (Batch (None, 208, 208, 32) 128
_________________________________________________________________
leaky_re_lu_2 (LeakyReLU) (None, 208, 208, 32) 0
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 104, 104, 32) 0
_________________________________________________________________
conv2d_3 (Conv2D) (None, 104, 104, 64) 18432
_________________________________________________________________
batch_normalization_3 (Batch (None, 104, 104, 64) 256
_________________________________________________________________
leaky_re_lu_3 (LeakyReLU) (None, 104, 104, 64) 0
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 52, 52, 64) 0
_________________________________________________________________
conv2d_4 (Conv2D) (None, 52, 52, 128) 73728
_________________________________________________________________
batch_normalization_4 (Batch (None, 52, 52, 128) 512
_________________________________________________________________
leaky_re_lu_4 (LeakyReLU) (None, 52, 52, 128) 0
_________________________________________________________________
max_pooling2d_4 (MaxPooling2 (None, 26, 26, 128) 0
_________________________________________________________________
conv2d_5 (Conv2D) (None, 26, 26, 256) 294912
_________________________________________________________________
batch_normalization_5 (Batch (None, 26, 26, 256) 1024
_________________________________________________________________
leaky_re_lu_5 (LeakyReLU) (None, 26, 26, 256) 0
_________________________________________________________________
max_pooling2d_5 (MaxPooling2 (None, 13, 13, 256) 0
_________________________________________________________________
conv2d_6 (Conv2D) (None, 13, 13, 512) 1179648
_________________________________________________________________
batch_normalization_6 (Batch (None, 13, 13, 512) 2048
_________________________________________________________________
leaky_re_lu_6 (LeakyReLU) (None, 13, 13, 512) 0
_________________________________________________________________
max_pooling2d_6 (MaxPooling2 (None, 13, 13, 512) 0
_________________________________________________________________
conv2d_7 (Conv2D) (None, 13, 13, 1024) 4718592
_________________________________________________________________
batch_normalization_7 (Batch (None, 13, 13, 1024) 4096
_________________________________________________________________
leaky_re_lu_7 (LeakyReLU) (None, 13, 13, 1024) 0
_________________________________________________________________
conv2d_8 (Conv2D) (None, 13, 13, 512) 4718592
_________________________________________________________________
batch_normalization_8 (Batch (None, 13, 13, 512) 2048
_________________________________________________________________
leaky_re_lu_8 (LeakyReLU) (None, 13, 13, 512) 0
_________________________________________________________________
conv2d_9 (Conv2D) (None, 13, 13, 425) 218025
=================================================================
Total params: 11,237,145
Trainable params: 11,232,057
Non-trainable params: 5,088
_________________________________________________________________
0 : input_1, <keras.engine.topology.InputLayer object at 0x11d8fd590>
1 : conv2d_1, <keras.layers.convolutional.Conv2D object at 0x11d8fd910>
2 : batch_normalization_1, <keras.layers.normalization.BatchNormalization object at 0x11d8fd9d0>
/Users/WeiJay/anaconda/envs/py2/lib/python2.7/site-packages/coremltools/converters/keras/_layers2.py:499: RuntimeWarning: invalid value encountered in sqrt
f = 1.0 / _np.sqrt(std + keras_layer.epsilon)
3 : leaky_re_lu_1, <keras.layers.advanced_activations.LeakyReLU object at 0x11d8fdb90>
4 : max_pooling2d_1, <keras.layers.pooling.MaxPooling2D object at 0x11d8fd810>
5 : conv2d_2, <keras.layers.convolutional.Conv2D object at 0x11d8fd850>
6 : batch_normalization_2, <keras.layers.normalization.BatchNormalization object at 0x11d8fda50>
7 : leaky_re_lu_2, <keras.layers.advanced_activations.LeakyReLU object at 0x11d8fdc10>
8 : max_pooling2d_2, <keras.layers.pooling.MaxPooling2D object at 0x11d8fddd0>
9 : conv2d_3, <keras.layers.convolutional.Conv2D object at 0x11d9383d0>
10 : batch_normalization_3, <keras.layers.normalization.BatchNormalization object at 0x11d9385d0>
11 : leaky_re_lu_3, <keras.layers.advanced_activations.LeakyReLU object at 0x11d938750>
12 : max_pooling2d_3, <keras.layers.pooling.MaxPooling2D object at 0x11d938650>
13 : conv2d_4, <keras.layers.convolutional.Conv2D object at 0x11d9387d0>
14 : batch_normalization_4, <keras.layers.normalization.BatchNormalization object at 0x11d938810>
15 : leaky_re_lu_4, <keras.layers.advanced_activations.LeakyReLU object at 0x11d938950>
16 : max_pooling2d_4, <keras.layers.pooling.MaxPooling2D object at 0x11d938a90>
17 : conv2d_5, <keras.layers.convolutional.Conv2D object at 0x11d938b10>
18 : batch_normalization_5, <keras.layers.normalization.BatchNormalization object at 0x11d938b50>
19 : leaky_re_lu_5, <keras.layers.advanced_activations.LeakyReLU object at 0x11d938c90>
20 : max_pooling2d_5, <keras.layers.pooling.MaxPooling2D object at 0x11d938dd0>
21 : conv2d_6, <keras.layers.convolutional.Conv2D object at 0x11d938e50>
22 : batch_normalization_6, <keras.layers.normalization.BatchNormalization object at 0x11d938e90>
23 : leaky_re_lu_6, <keras.layers.advanced_activations.LeakyReLU object at 0x11d938fd0>
24 : max_pooling2d_6, <keras.layers.pooling.MaxPooling2D object at 0x11d94d150>
25 : conv2d_7, <keras.layers.convolutional.Conv2D object at 0x11d94d1d0>
26 : batch_normalization_7, <keras.layers.normalization.BatchNormalization object at 0x11d94d210>
27 : leaky_re_lu_7, <keras.layers.advanced_activations.LeakyReLU object at 0x11d94d350>
28 : conv2d_8, <keras.layers.convolutional.Conv2D object at 0x11d94d490>
29 : batch_normalization_8, <keras.layers.normalization.BatchNormalization object at 0x11d94d4d0>
30 : leaky_re_lu_8, <keras.layers.advanced_activations.LeakyReLU object at 0x11d94d610>
31 : conv2d_9, <keras.layers.convolutional.Conv2D object at 0x11d94d750>
Input name(s) and shape(s):
image : (C,H,W) = (3, 416, 416)
Neural Network compiler 0: 100 , name = conv2d_1, output shape : (C,H,W) = (16, 416, 416)
Neural Network compiler 1: 160 , name = batch_normalization_1, output shape : (C,H,W) = (16, 416, 416)
Neural Network compiler 2: 130 , name = leaky_re_lu_1, output shape : (C,H,W) = (16, 416, 416)
Neural Network compiler 3: 120 , name = max_pooling2d_1, output shape : (C,H,W) = (16, 208, 208)
Neural Network compiler 4: 100 , name = conv2d_2, output shape : (C,H,W) = (32, 208, 208)
Neural Network compiler 5: 160 , name = batch_normalization_2, output shape : (C,H,W) = (32, 208, 208)
Neural Network compiler 6: 130 , name = leaky_re_lu_2, output shape : (C,H,W) = (32, 208, 208)
Neural Network compiler 7: 120 , name = max_pooling2d_2, output shape : (C,H,W) = (32, 104, 104)
Neural Network compiler 8: 100 , name = conv2d_3, output shape : (C,H,W) = (64, 104, 104)
Neural Network compiler 9: 160 , name = batch_normalization_3, output shape : (C,H,W) = (64, 104, 104)
Neural Network compiler 10: 130 , name = leaky_re_lu_3, output shape : (C,H,W) = (64, 104, 104)
Neural Network compiler 11: 120 , name = max_pooling2d_3, output shape : (C,H,W) = (64, 52, 52)
Neural Network compiler 12: 100 , name = conv2d_4, output shape : (C,H,W) = (128, 52, 52)
Neural Network compiler 13: 160 , name = batch_normalization_4, output shape : (C,H,W) = (128, 52, 52)
Neural Network compiler 14: 130 , name = leaky_re_lu_4, output shape : (C,H,W) = (128, 52, 52)
Neural Network compiler 15: 120 , name = max_pooling2d_4, output shape : (C,H,W) = (128, 26, 26)
Neural Network compiler 16: 100 , name = conv2d_5, output shape : (C,H,W) = (256, 26, 26)
Neural Network compiler 17: 160 , name = batch_normalization_5, output shape : (C,H,W) = (256, 26, 26)
Neural Network compiler 18: 130 , name = leaky_re_lu_5, output shape : (C,H,W) = (256, 26, 26)
Neural Network compiler 19: 120 , name = max_pooling2d_5, output shape : (C,H,W) = (256, 13, 13)
Neural Network compiler 20: 100 , name = conv2d_6, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 21: 160 , name = batch_normalization_6, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 22: 130 , name = leaky_re_lu_6, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 23: 120 , name = max_pooling2d_6, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 24: 100 , name = conv2d_7, output shape : (C,H,W) = (1024, 13, 13)
Neural Network compiler 25: 160 , name = batch_normalization_7, output shape : (C,H,W) = (1024, 13, 13)
Neural Network compiler 26: 130 , name = leaky_re_lu_7, output shape : (C,H,W) = (1024, 13, 13)
Neural Network compiler 27: 100 , name = conv2d_8, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 28: 160 , name = batch_normalization_8, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 29: 130 , name = leaky_re_lu_8, output shape : (C,H,W) = (512, 13, 13)
Neural Network compiler 30: 100 , name = conv2d_9, output shape : (C,H,W) = (425, 13, 13)