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

NeuralStyleTransfer failed #659

Closed
sjsdfg opened this issue Apr 8, 2018 · 6 comments
Closed

NeuralStyleTransfer failed #659

sjsdfg opened this issue Apr 8, 2018 · 6 comments
Labels

Comments

@sjsdfg
Copy link
Contributor

sjsdfg commented Apr 8, 2018

when i run this example NeuralStyleTransfer
i get an NPE.

1:24:31,059 INFO  ~ iteration  0
Exception in thread "main" java.lang.NullPointerException
	at org.deeplearning4j.nn.layers.convolution.ConvolutionLayer.backpropGradient(ConvolutionLayer.java:134)
	at org.deeplearning4j.examples.styletransfer.NeuralStyleTransfer.backPropagate(NeuralStyleTransfer.java:284)
	at org.deeplearning4j.examples.styletransfer.NeuralStyleTransfer.backPropagateStyles(NeuralStyleTransfer.java:159)
	at org.deeplearning4j.examples.styletransfer.NeuralStyleTransfer.transferStyle(NeuralStyleTransfer.java:131)
	at org.deeplearning4j.examples.styletransfer.NeuralStyleTransfer.main(NeuralStyleTransfer.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

the exception is caused by 134 line in ConvolutionLayer.java:134
the content is int miniBatch = this.input.size(0);

what causes this? that value should be 1.

@RobAltena
Copy link
Contributor

I have reproduced this error on 1.0.0-alpha.

@saudet saudet added the bug label Apr 9, 2018
@liweigu
Copy link

liweigu commented Apr 9, 2018

int miniBatch = input.size(0);
The 'input' is null there.

@liweigu
Copy link

liweigu commented Apr 9, 2018

I found a way to run this example:

  1. Comment out the line:
    Map<String, INDArray> activationsCombMap = vgg16FineTune.feedForward(combination, true);
  2. Add these codes instead:
    INDArray[] input = new INDArray[] { combination };
    boolean train = true;
    boolean clearInputs = false;
    Map<String, INDArray> activationsCombMap = vgg16FineTune.feedForward(input, train, clearInputs);

@RobAltena
Copy link
Contributor

@liweigu Thank you for fixing the issue. Appreciated.

@sjsdfg
Copy link
Contributor Author

sjsdfg commented Apr 10, 2018

that is magic. when i debug this program. after line 131, the inputs is still in vgg16FineTune.
how can i insert a picture to show that?

@sjsdfg
Copy link
Contributor Author

sjsdfg commented Apr 10, 2018

agibsonccc pushed a commit that referenced this issue Apr 17, 2018
Fixes #659 cleans up all compiler warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants