tupleblog / face-classification-js

Face classification on JavaScript
https://tupleblog.github.io/face-classification-js/
MIT License
35 stars 5 forks source link

Model Conversion Problem #1

Closed kittinan closed 6 years ago

kittinan commented 6 years ago

Convert model from

https://github.com/oarriaga/face_classification/tree/master/trained_models/emotion_models

get many error

Keras.JS lastest version

Error: [Model] error loading weights.
    at keras.min.js:1
    at Array.map (<anonymous>)
    at t (keras.min.js:1)
    at keras.min.js:1
    at Array.forEach (<anonymous>)
    at t (keras.min.js:1)
    at t (keras.min.js:1)
    at r (keras.min.js:1)
    at Generator.i [as _invoke] (keras.min.js:1)
    at Generator.t.(:8989/anonymous function) [as next] (https://unpkg.com/keras-js@1.0.3/dist/keras.min.js:1:449112)
    at i (keras.min.js:1)
    at a (keras.min.js:1)

Tensorflow.JS 0.7

Uncaught (in promise) Error: Unknown layer: SeparableConv2D
    at new t (tfjs@0.7:1)
    at Object.n.deserializeKerasObject (tfjs@0.7:1)
    at Object.n.deserialize (tfjs@0.7:1)
    at p (tfjs@0.7:1)
    at t.fromConfig (tfjs@0.7:1)
    at Object.n.deserializeKerasObject (tfjs@0.7:1)
    at Object.n.deserialize (tfjs@0.7:1)
    at tfjs@0.7:1
    at r (tfjs@0.7:1)
    at Object.next (tfjs@0.7:1)

Tensorflow.JS 0.9

Uncaught (in promise) Error: Could not find weights in manifest with names: conv2d_1/kernel, batch_normalization_1/gamma, batch_normalization_1/beta, conv2d_2/kernel, batch_normalization_2/gamma, batch_normalization_2/beta, separable_conv2d_1/depthwise_kernel, separable_conv2d_1/pointwise_kernel, batch_normalization_4/gamma, batch_normalization_4/beta, separable_conv2d_2/depthwise_kernel, separable_conv2d_2/pointwise_kernel, batch_normalization_5/gamma, batch_normalization_5/beta, conv2d_3/kernel, batch_normalization_3/gamma, batch_normalization_3/beta, separable_conv2d_3/depthwise_kernel, separable_conv2d_3/pointwise_kernel, batch_normalization_7/gamma, batch_normalization_7/beta, separable_conv2d_4/depthwise_kernel, separable_conv2d_4/pointwise_kernel, batch_normalization_8/gamma, batch_normalization_8/beta, conv2d_4/kernel, batch_normalization_6/gamma, batch_normalization_6/beta, separable_conv2d_5/depthwise_kernel, separable_conv2d_5/pointwise_kernel, batch_normalization_10/gamma, batch_normalization_10/beta, separable_conv2d_6/depthwise_kernel, separable_conv2d_6/pointwise_kernel, batch_normalization_11/gamma, batch_normalization_11/beta, conv2d_5/kernel, batch_normalization_9/gamma, batch_normalization_9/beta, separable_conv2d_7/depthwise_kernel, separable_conv2d_7/pointwise_kernel, batch_normalization_13/gamma, batch_normalization_13/beta, separable_conv2d_8/depthwise_kernel, separable_conv2d_8/pointwise_kernel, batch_normalization_14/gamma, batch_normalization_14/beta, conv2d_6/kernel, batch_normalization_12/gamma, batch_normalization_12/beta, conv2d_7/kernel, conv2d_7/bias, batch_normalization_1/moving_mean, batch_normalization_1/moving_variance, batch_normalization_2/moving_mean, batch_normalization_2/moving_variance, batch_normalization_4/moving_mean, batch_normalization_4/moving_variance, batch_normalization_5/moving_mean, batch_normalization_5/moving_variance, batch_normalization_3/moving_mean, batch_normalization_3/moving_variance, batch_normalization_7/moving_mean, batch_normalization_7/moving_variance, batch_normalization_8/moving_mean, batch_normalization_8/moving_variance, batch_normalization_6/moving_mean, batch_normalization_6/moving_variance, batch_normalization_10/moving_mean, batch_normalization_10/moving_variance, batch_normalization_11/moving_mean, batch_normalization_11/moving_variance, batch_normalization_9/moving_mean, batch_normalization_9/moving_variance, batch_normalization_13/moving_mean, batch_normalization_13/moving_variance, batch_normalization_14/moving_mean, batch_normalization_14/moving_variance, batch_normalization_12/moving_mean, batch_normalization_12/moving_variance. 
Manifest JSON has weights with names: batch_normalization_1_1/gamma, batch_normalization_1_1/beta, batch_normalization_1_1/moving_mean, batch_normalization_1_1/moving_variance, batch_normalization_10_1/gamma, batch_normalization_10_1/beta, batch_normalization_10_1/moving_mean, batch_normalization_10_1/moving_variance, batch_normalization_11_1/gamma, batch_normalization_11_1/beta, batch_normalization_11_1/moving_mean, batch_normalization_11_1/moving_variance, batch_normalization_12_1/gamma, batch_normalization_12_1/beta, batch_normalization_12_1/moving_mean, batch_normalization_12_1/moving_variance, batch_normalization_13_1/gamma, batch_normalization_13_1/beta, batch_normalization_13_1/moving_mean, batch_normalization_13_1/moving_variance, batch_normalization_14_1/gamma, batch_normalization_14_1/beta, batch_normalization_14_1/moving_mean, batch_normalization_14_1/moving_variance, batch_normalization_2_1/gamma, batch_normalization_2_1/beta, batch_normalization_2_1/moving_mean, batch_normalization_2_1/moving_variance, batch_normalization_3_1/gamma, batch_normalization_3_1/beta, batch_normalization_3_1/moving_mean, batch_normalization_3_1/moving_variance, batch_normalization_4_1/gamma, batch_normalization_4_1/beta, batch_normalization_4_1/moving_mean, batch_normalization_4_1/moving_variance, batch_normalization_5_1/gamma, batch_normalization_5_1/beta, batch_normalization_5_1/moving_mean, batch_normalization_5_1/moving_variance, batch_normalization_6_1/gamma, batch_normalization_6_1/beta, batch_normalization_6_1/moving_mean, batch_normalization_6_1/moving_variance, batch_normalization_7_1/gamma, batch_normalization_7_1/beta, batch_normalization_7_1/moving_mean, batch_normalization_7_1/moving_variance, batch_normalization_8_1/gamma, batch_normalization_8_1/beta, batch_normalization_8_1/moving_mean, batch_normalization_8_1/moving_variance, batch_normalization_9_1/gamma, batch_normalization_9_1/beta, batch_normalization_9_1/moving_mean, batch_normalization_9_1/moving_variance, conv2d_1_1/kernel, conv2d_2_1/kernel, conv2d_3_1/kernel, conv2d_4_1/kernel, conv2d_5_1/kernel, conv2d_6_1/kernel, conv2d_7_1/kernel, conv2d_7_1/bias, separable_conv2d_1_1/depthwise_kernel, separable_conv2d_1_1/pointwise_kernel, separable_conv2d_2_1/depthwise_kernel, separable_conv2d_2_1/pointwise_kernel, separable_conv2d_3_1/depthwise_kernel, separable_conv2d_3_1/pointwise_kernel, separable_conv2d_4_1/depthwise_kernel, separable_conv2d_4_1/pointwise_kernel, separable_conv2d_5_1/depthwise_kernel, separable_conv2d_5_1/pointwise_kernel, separable_conv2d_6_1/depthwise_kernel, separable_conv2d_6_1/pointwise_kernel, separable_conv2d_7_1/depthwise_kernel, separable_conv2d_7_1/pointwise_kernel, separable_conv2d_8_1/depthwise_kernel, separable_conv2d_8_1/pointwise_kernel.
    at Object.<anonymous> (tfjs@0.9.1:1)
    at r (tfjs@0.9.1:1)
    at Object.next (tfjs@0.9.1:1)
    at tfjs@0.9.1:1
    at new Promise (<anonymous>)
    at r (tfjs@0.9.1:1)
    at Object.n.loadWeights (tfjs@0.9.1:1)
    at tfjs@0.9.1:1
    at r (tfjs@0.9.1:1)
    at Object.next (tfjs@0.9.1:1)
kittinan commented 6 years ago

Tensorflow.JS can run Mobilenet. I think we can retrain with Mobilenet

kittinan commented 6 years ago

MobileNet :tada: :tada: :tada: