Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keras import Permute layer error #6489

Closed
ilyaivensky opened this issue Sep 25, 2018 · 3 comments
Closed

Keras import Permute layer error #6489

ilyaivensky opened this issue Sep 25, 2018 · 3 comments
Labels
Bug Bugs and problems DL4J Keras Issues related to Keras import

Comments

@ilyaivensky
Copy link

ilyaivensky commented Sep 25, 2018

I got the following error in the import:

Error deserializing JSON ComputationGraphConfiguration. Saved model JSON is not a valid ComputationGraphConfiguration
java.lang.RuntimeException: Error deserializing JSON ComputationGraphConfiguration. Saved model JSON is not a valid ComputationGraphConfiguration

when added this code in Keras:

    x = Permute((2, 1))(x)
    x = Flatten()(x)
    x = RepeatVector(64)(x)
    x = Permute((2, 1))(x)

Originally posted by @ilyaivensky in #6488 (comment)

@ilyaivensky
Copy link
Author

More details:

Caused by: java.lang.RuntimeException: org.nd4j.shade.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class org.deeplearning4j.nn.modelimport.keras.preprocessors.PermutePreprocessor]: can not instantiate from JSON object (missing default constructor or creator, or perhaps need to add/enable type information?)
at [Source: java.io.StringReader@4587675c; line: 937, column: 95] (through reference chain: org.deeplearning4j.nn.conf.ComputationGraphConfiguration["vertices"]->java.util.LinkedHashMap["permute_1"]->org.deeplearning4j.nn.conf.graph.PreprocessorVertex["preProcessor"])
at org.deeplearning4j.nn.conf.ComputationGraphConfiguration.fromJson(ComputationGraphConfiguration.java:174)
at org.deeplearning4j.util.ModelSerializer.restoreComputationGraph(ModelSerializer.java:622)

@maxpumperla maxpumperla added Bug Bugs and problems DL4J Keras Issues related to Keras import labels Sep 26, 2018
@maxpumperla maxpumperla self-assigned this Sep 26, 2018
@AlexDBlack AlexDBlack assigned AlexDBlack and unassigned maxpumperla Oct 1, 2018
@AlexDBlack
Copy link
Contributor

Fixed here: #6504
Thanks for reporting

@AlexDBlack AlexDBlack mentioned this issue Oct 1, 2018
AlexDBlack added a commit that referenced this issue Oct 3, 2018
* #6501 Fix multiple issues with Xception configuration

* #6500 Fix SqueezeNet (non-pretrained) config + add tests

* #6497 Fix multi-output net evaluation for ComputationGraph

* #6502 fix formatting for ComputationGraph summary

* #6502 fix formatting for MultiLayerNetwork summary

* #6489 fix JSON mapping for keras import preprocessors

* Switch default output layer activation to softmax

* Fix transposei issues with autoencoder

* Minor test fixes

* ComputationGraph: Fix possible double application of preprocessors and setting input for output layers when doing backprop

* Workspace fix for output layer dropout in compgraph
@lock
Copy link

lock bot commented Nov 2, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Bugs and problems DL4J Keras Issues related to Keras import
Projects
None yet
Development

No branches or pull requests

3 participants