Skip to content

Lambda layers in the keras model #43

@gnsmrky

Description

@gnsmrky

Continued test from issue #41, it seems like the exported keras model has lambda op. Is it correct?

output of print (k_model.summary()) in #41

Layer (type)                 Output Shape              Param #   
=================================================================
input0 (InputLayer)          (None, 3, 224, 224)       0         
_________________________________________________________________
lambda_1 (Lambda)            (None, 3, 232, 232)       0         <-- lambda layer
_________________________________________________________________
conv1.conv2d0.19608361958321 (None, 32, 224, 224)      7808      
_________________________________________________________________
in10.5890283736035935 (Lambd (None, 32, 224, 224)      0         <-- lambda layer
_________________________________________________________________
relu0.8399978862622054 (Acti (None, 32, 224, 224)      0         
=================================================================
Total params: 7,808
Trainable params: 7,808
Non-trainable params: 0

Trying to make the generated keras model file to tfjs (which does not support lambda layer). Knowing that lambda can be any python codes. This would make it not portable to non-python frameworks, such as c++ or js based ones.

Don't know if it's logical to ask, but is it possible to workaround this requirements for lambda layer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions