4
$\begingroup$

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

net = NetInitialize[
  NetGraph[
   <|
    "Conv" -> 
      NetMapOperator[
        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?

$\endgroup$
2
  • $\begingroup$ P.S., I do need varying dimensions in the application. $\endgroup$ Jun 21, 2018 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, 2018 at 18:19

1 Answer 1

3
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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