Closed soulhi-vz closed 4 years ago
Hi @soulhi-vz. Next time please post an issue regarding code not working as expected to StackOverflow, I would like to keep issues clean for implementation bugs/feature requests, thanks.
Everything works as expected, torch.nn.Linear
cannot be applied to Conv1d
without torch.nn.MaxPool1d
(or tl.MaxPool
), at least not in the way you think it should be (encoder's last Conv1d
last dimension [which can vary] will be used to infer input shape to tl.Linear
, at least for torchlayers-nightly
package [0.1.1
has bug of not working as PyTorch original nn.Linear
for multiple dimensions]).
Please use tl.GlobalMaxPool
before tl.Linear
or tl.Flatten()
(and use tl.Reshape
before nn.ConvTranspose1d
as well) or just try to rewrite it in pure PyTorch and post to StackOverflow in case you have any questions.
Hi ,
The following model works without the tl layer:
I have added
tl.Linear(2)
as the compressed layer between the encoder and decoder.Autoencoder_tl = tl.build(Autoencoder(), Train_x_t_e)
will throw this error: