pytorch2keras
pytorch2keras copied to clipboard
reshape after view is wrong
Describe the bug
Linear followed by a view leads to incorrect result, tensorflowjs complains shape mismatch [NULL, output_size]. changing
reshape = keras.layers.Reshape([-1], name=tf_name)
to match the input shape seems to fix the problem
To Reproduce Snippet of your code
x = x.view(self.batch_size, -1)
self.output = nn.Linear(x.shape[1], output_size)
I find the same problem,so how can you handle it?
https://github.com/nerox8664/pytorch2keras/pull/77
had a pull request, fixed my problem but didn't get merged