My problem is “fitting a 1D signal”. the signals are stored in a CSV file with the size of 1000 * 2069 (1:2048 → features, 2049:2069 → targets/labels).
I loaded a CSV file using this piece of code:
(I do not know it is okay or not) however this time i got this error:
Exception in thread "main" java.lang.IllegalStateException: Invalid input, does not match configuration: expected [minibatch, numChannels=1, inputHeight=1, inputWidth=2048] but got input array ofshape [800, 2048, 1, 1]
Exception in thread "main" java.lang.IllegalArgumentException: Invalid input: expect CNN activations with rank 4 (received input with shape [800, 2048])
at org.deeplearning4j.nn.conf.preprocessor.CnnToRnnPreProcessor.preProcess(CnnToRnnPreProcessor.java:74)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.ffToLayerActivationsInWs(MultiLayerNetwork.java:1122)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.computeGradientAndScore(MultiLayerNetwork.java:2750)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.computeGradientAndScore(MultiLayerNetwork.java:2708)
at org.deeplearning4j.optimize.solvers.BaseOptimizer.gradientAndScore(BaseOptimizer.java:170)
at org.deeplearning4j.optimize.solvers.StochasticGradientDescent.optimize(StochasticGradientDescent.java:63)
at org.deeplearning4j.optimize.Solver.optimize(Solver.java:52)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fitHelper(MultiLayerNetwork.java:2309)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fit(MultiLayerNetwork.java:2267)
at org.deeplearning4j.nn.multilayer.MultiLayerNetwork.fit(MultiLayerNetwork.java:2330)
at org.deeplearning4j.examples.convolution.oneDConv.main(oneDConv.java:90)
Thank you very much @treo. It works. It should be mentioned that I changed the network layers from 1D to 2D; because after I changed setInputType to feedforward, I got an error in which stated Conv1D needs RNN input.
I am dealing with a similar issue, and can’t get it working. Is there any chance you could post your fixed code? There are not a lot of examples online how to get this to work.