I am trying to convert a keras model into a CoreML model, and folloing is summary.
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv1 (Conv1D) (None, 6000, 5) 725
_________________________________________________________________
activation_1 (Activation) (None, 6000, 5) 0
_________________________________________________________________
conv2 (Conv1D) (None, 6000, 5) 305
_________________________________________________________________
activation_2 (Activation) (None, 6000, 5) 0
_________________________________________________________________
conv3 (Conv1D) (None, 6000, 5) 305
_________________________________________________________________
activation_3 (Activation) (None, 6000, 5) 0
_________________________________________________________________
conv4 (Conv1D) (None, 6000, 5) 305
_________________________________________________________________
activation_4 (Activation) (None, 6000, 5) 0
_________________________________________________________________
max_pooling1d_1 (MaxPooling1 (None, 1200, 5) 0
=================================================================
In Xcode, my code is following
@objc func count(){
var csvArray: [NSNumber] = loadCSV(filename: "x1")
csvArray.removeLast()
guard let mlarray = try? MLMultiArray(shape:[1, 6000, 12], dataType:MLMultiArrayDataType.float32) else {
fatalError("Unexpected runtime error. MLMultiArray")
}
for (index, element) in csvArray.enumerated() {
mlarray[index] = element
}
let i = fit_hoge6Input(input1: mlarray)
let model = fit_hoge6()
guard let result = try? model.prediction(input: i) else {
fatalError("error")
}//1*1200*5
print(result.output1)
The output is following
Double 6000 x 5 matrix
[0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
...
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;
0.4664617776870728,0.4912139475345612,0.4796954393386841,0.484947144985199,0.4818514585494995;]
All value is same.
and model.predition output is following message.
"Extension[37287:2436870] BNNS_POOLING: supported pooling dimensions: k_width == k_height and x_stride == y_stride"
On the other hand, when I execute code in python, output is following.
[[[0.4664617e-01,0.49121394e-01, 0.47969544e-01,0.484947144e-01,0.48185145e-01,
[3.2913774e-01, 3.9123061e-01, 2.86454583e-01, 4.83056443e-01, 2.7176388e-01,
...,
]
My model use maxpooling1d, but error message is k_width == k_height.
This is strange.
I want to know whether maxpooling1d is supported or not.