Keras import : ClassCastException between layers.recurrent.LastTimeStep and layers.FeedForwardLayer

Hello,

Issue Description

I am importing a Keras model that you can find on this colab using the follwing code :

// Import model
ComputationGraph model = KerasModelImport.importKerasModelAndWeights("/path/to/model.h5", true);
System.out.println(model.summary());

and it returns me

Exception in thread "main" java.lang.ClassCastException: class org.deeplearning4j.nn.conf.layers.recurrent.LastTimeStep cannot be cast to class org.deeplearning4j.nn.conf.layers.FeedForwardLayer (org.deeplearning4j.nn.conf.layers.recurrent.LastTimeStep and org.deeplearning4j.nn.conf.layers.FeedForwardLayer are in unnamed module of loader 'app')
	at org.deeplearning4j.nn.modelimport.keras.layers.recurrent.KerasLSTM.setWeights(KerasLSTM.java:449)
	at org.deeplearning4j.nn.modelimport.keras.utils.KerasModelUtils.importWeights(KerasModelUtils.java:302)
	at org.deeplearning4j.nn.modelimport.keras.KerasModel.<init>(KerasModel.java:183)
	at org.deeplearning4j.nn.modelimport.keras.KerasModel.<init>(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:155)
	at org.lara.rnn.Main.main(Main.java:10)

Version Information

  • Deeplearning4j version : 1.0.0-beta6
  • Platform information : Ubuntu 19.04 (64 Bits)
  • CUDA version : not used
  • NVIDIA driver version : not used

Additional Information

Where applicable, please also provide:

  • Full log or exception stack trace : see github issue
  • pom.xml : see github issue

I opened a GIthub issue here : https://github.com/eclipse/deeplearning4j/issues/8924?fbclid=IwAR28TdwQJW1WWPMhxkFkCmz8C-W-JEwQ6Fv8zoMfce-Opq5LnGK9wYLE9Mg

PS: I have the same results with SNAPSHOT from 06/05/2020