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

Comments

@ilyaivensky
Copy link

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

This comment has been minimized.

Copy link
Author

commented Sep 25, 2018

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)

@AlexDBlack

This comment has been minimized.

Copy link
Contributor

commented Oct 1, 2018

Fixed here: #6504
Thanks for reporting

@AlexDBlack AlexDBlack referenced this issue Oct 1, 2018
AlexDBlack added a commit that referenced this issue Oct 3, 2018
Misc fixes (#6504)
* #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

This comment has been minimized.

Copy link

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.
Projects
None yet
3 participants
You can’t perform that action at this time.