# Unsupported keras layer type MyCrossLayer

**URL:** <https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773>\
**Category:** DL4J\
**Created:** [August 6, 2020, 3:45am UTC](https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773 "2020-08-06T03:45:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![1329154840](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/1329154840/32/286_2.png) [@1329154840](https://community.konduit.ai/u/1329154840)\
**Post date:** [August 6, 2020, 3:45am UTC](https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773/1 "2020-08-06T03:45:55Z")

</div>

I customized keras layer by myself in python keras. When I read .h5 file call the error.

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.  
SLF4J: Defaulting to no-operation (NOP) logger implementation  
SLF4J: See [SLF4J Error Codes](http://www.slf4j.org/codes.html#StaticLoggerBinder) for further details.  
Exception in thread “main” org.deeplearning4j.nn.modelimport.keras.exceptions.UnsupportedKerasConfigurationException: Unsupported keras layer type MyCrossLayer. Please file an issue at [Issues · eclipse/deeplearning4j · GitHub](https://github.com/eclipse/deeplearning4j/issues).  
at org.deeplearning4j.nn.modelimport.keras.utils.KerasLayerUtils.getKerasLayerFromConfig(KerasLayerUtils.java:334)  
at org.deeplearning4j.nn.modelimport.keras.KerasModel.prepareLayers(KerasModel.java:218)  
at org.deeplearning4j.nn.modelimport.keras.KerasModel.(KerasModel.java:164)  
at org.deeplearning4j.nn.modelimport.keras.KerasModel.(KerasModel.java:96)  
at org.deeplearning4j.nn.modelimport.keras.utils.KerasModelBuilder.buildModel(KerasModelBuilder.java:307)  
at org.deeplearning4j.nn.modelimport.keras.KerasModelImport.importKerasModelAndWeights(KerasModelImport.java:172)  
at Formatter.main(Formatter.java:12)

---

<div class="post-metadata">

**Author:** ![1329154840](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/1329154840/32/286_2.png) [@1329154840](https://community.konduit.ai/u/1329154840)\
**Post date:** [August 6, 2020, 3:50am UTC](https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773/2 "2020-08-06T03:50:57Z")

</div>

![WechatIMG38](https://canada1.discourse-cdn.com/flex035/uploads/konduit/original/1X/4265bff9fb614176112a1dd65583c413eba3964f.png)

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [August 7, 2020, 12:02pm UTC](https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773/3 "2020-08-07T12:02:33Z")

</div>

Hi, you need to register an equivalent layer in dl4j in order for the model import to work. You can find an overview here: [https://jrmerwin.github.io/deeplearning4j-docs/model-import-keras.html](https://jrmerwin.github.io/deeplearning4j-docs/model-import-keras.html)

---

<div class="post-metadata">

**Author:** ![1329154840](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/1329154840/32/286_2.png) [@1329154840](https://community.konduit.ai/u/1329154840)\
**Post date:** [August 10, 2020, 2:52am UTC](https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773/4 "2020-08-10T02:52:03Z")

</div>

Can you give me some '‘register an equivalent layer’‘ example.I can’t find in this overview

---

<div class="post-metadata">

**Author:** ![eduardo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/eduardo/32/24_2.png) [@eduardo](https://community.konduit.ai/u/eduardo)\
**Post date:** [August 11, 2020, 8:38am UTC](https://community.konduit.ai/t/unsupported-keras-layer-type-mycrosslayer/773/5 "2020-08-11T08:38:23Z")

</div>

You can find some simple examples of defining a SameDiffLambdaLayer here: [https://github.com/eclipse/deeplearning4j/blob/master/deeplearning4j/deeplearning4j-modelimport/src/test/java/org/deeplearning4j/nn/modelimport/keras/e2e/KerasLambdaTest.java#L47](https://github.com/eclipse/deeplearning4j/blob/master/deeplearning4j/deeplearning4j-modelimport/src/test/java/org/deeplearning4j/nn/modelimport/keras/e2e/KerasLambdaTest.java#L47)

There’s also this guide with a little more information and background on defining custom layers: [https://deeplearning4j.konduit.ai/keras-import/custom-layers](https://deeplearning4j.konduit.ai/keras-import/custom-layers)
