I am trying a recurrent network in Linux server using MMA 11.3. The network structure is as follows:

net = NetInitialize[
    "Conv" -> 
        NetChain[{ConvolutionLayer[3, {3, 3}], FlattenLayer[]}, "Input" -> {5, 11, 11}]], 
    "LSTM1" -> LongShortTermMemoryLayer[40, "Dropout" -> 0.4], 
    "Dropout" -> DropoutLayer[0.3], 
    "Linear" -> NetMapOperator[LinearLayer[1]], "Ramp" -> Ramp, 
    "Sum" -> SummationLayer[]
   {NetPort["Circulation"] -> "Conv" -> "LSTM1" -> "Dropout" -> "Linear" -> "Ramp" 
       -> "Sum" -> NetPort["TotalPrecipitation"], 
    "Ramp" -> NetPort["HourlyPrecipitation"]}

It works for MMA 11.3 Macbook Pro. However, when I copied the code to the Linux server for training using GPU, it reports that:

NetGraph::valfail: Validation failed for SummationLayer: Layer does not support varying dimensions.

Could anyone help?

  • $\begingroup$ P.S., I do need varying dimensions in the application. $\endgroup$ – Baoxiang Pan Jun 21 '18 at 3:42
  • $\begingroup$ Hypothesis: your mac has a newer NeuralNetworks paclet version, and this is only supported in the latest version. Try Lookup[PacletInformation["NeuralNetworks"], "Version"] on both machines. Just run PacletUpdate["NeuralNetworks"] on your Linux machine if older version. $\endgroup$ – Sebastian Jun 22 '18 at 18:19

I am not sure if this is a bug, but since in the document of SummationLayer, we have:

r = RandomReal[1, {5, 3, 2}];
SummationLayer[][r] === AggregationLayer[Total, All][r]

Thus, by replacing SummationLayer with AggregationLayer[Total,All], the network could be initialized.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.