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

reshapeFunction not initialized after model load #24

Closed
quickstep24 opened this issue Dec 19, 2020 · 1 comment
Closed

reshapeFunction not initialized after model load #24

quickstep24 opened this issue Dec 19, 2020 · 1 comment
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@quickstep24
Copy link

quickstep24 commented Dec 19, 2020

I store a model with

val model = Sequential.of(
            Input(...),
            Dense(...),
            Dropout(...),
            Dense(...),
            Dense(1)
        )
model.compile(...)
model.fit(...)
model.save(dir, TF_GRAPH_CUSTOM_VARIABLES, true, FAIL_IF_EXISTS)

then I reload and use it with

val model = InferenceModel.load(dir)
model.predictSoftly(...)

But I get an exception:

Exception in thread "main" kotlin.UninitializedPropertyAccessException: lateinit property reshapeFunction has not been initialized
	at org.jetbrains.kotlinx.dl.api.inference.InferenceModel.predictSoftly(InferenceModel.kt:128)
	at org.jetbrains.kotlinx.dl.api.inference.InferenceModel.predictSoftly$default(InferenceModel.kt:127)

My fault or is this a bug?
Not sure about SavingFormat because two entries have same description.

@zaleslaw zaleslaw added the bug Something isn't working label Jan 12, 2021
@zaleslaw zaleslaw added this to the 0.1.1 milestone Jan 12, 2021
@zaleslaw zaleslaw added question Further information is requested bug Something isn't working and removed bug Something isn't working labels Jan 14, 2021
@zaleslaw
Copy link
Collaborator

Hi, @quickstep24 Thanks for the question.

  1. You used the correct format
  2. Reshape function is not serialized and should be write manually, look to this example
  3. In the method '''predictSoftly'' was an incorrect ''require'', I fixed it in the commit, closing this issue.
  4. Correct message and exception will be availalbe in 0.1.1 release

zaleslaw added a commit that referenced this issue Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants