3
$\begingroup$

So I created and initialized the following NetGraph:

faultyNet = NetInitialize@NetGraph[
   {
    LongShortTermMemoryLayer[20, "Input" -> {"Varying", 2}],
    TransposeLayer[]
    },
   {
    NetPort["Input"] -> 1 -> 2 -> NetPort["Output"]
    }]

which runs successfully. However, when I try to apply it to a test input like this:

faultyNet[{{1, 2}, {1, 2}, {1, 2}}]

I get the error message: "Cannot evaluate net: output of second layer is not fully specified." I've already tried the following troubleshooting options:

TransposeLayer["Output" -> {2, "Varying"}]
TransposeLayer[1<->2]

but none of them worked. Can someone please help me out?

$\endgroup$
  • 2
    $\begingroup$ You must specify the dimensions: TransposeLayer["Input" -> {3, 20}] will work. Unfortunately TransposeLayer cannot have a "Varying" output dimension that isn't the first one (as you can see by doing TransposeLayer["Input" -> {"Varying", 20}]) $\endgroup$ – Carl Lange Oct 1 '19 at 12:24

Your Answer

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

Browse other questions tagged or ask your own question.