question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect number of feature dimensions with VGG + RNN

See original GitHub issue

Hi,

I just ran into the following problem when trying to train with the VGG convnet (encoder type ‘vggblstmp’).

For an input of size B x T x F, VGG always returns a tensor of size Batch x T/4 x 128. One would assume that the number of feature dimensions for the subsequent RNN should also be 128.

But to determine the number of feature dimensions for the RNN, we call

def get_vgg2l_odim(idim, in_channel=3, out_channel=128):
    idim = idim / in_channel
    idim = np.ceil(np.array(idim, dtype=np.float32) / 2)  # 1st max pooling
    idim = np.ceil(np.array(idim, dtype=np.float32) / 2)  # 2nd max pooling
    return int(idim) * out_channel  # numer of channels

which yields F / 4 / in_channel * 128, causing a dimension mismatch. Shouldn’t that method just return the number of filters of the final convolutional layer (128)?

If this is the case, I can create a pull request.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sw005320commented, Jun 5, 2019

Sure, I’ll fix it.

0reactions
sw005320commented, Jun 5, 2019

Done. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recurrent Neural Networks - Combination of RNN and CNN
The layers one to five (Figure 4) are constrained to have the same number of feature maps K. Thereby RCNN-K denotes a network...
Read more >
LSTMs for Human Activity Recognition Time Series ...
The model requires a three-dimensional input with [samples, time steps, features].
Read more >
Plot causes "Error: Incorrect Number of Dimensions"
This produces an error: "Error: Incorrect Number of Dimensions". A similar error ( NAs by coercion ) is produced when attempting to cluster ......
Read more >
Using effective dimension to analyze feature ...
We study three trained architectures: a 12-hidden layer multi-layer perceptron (MLP), a convolutional neural net- work (CNN) similar in architecture to VGG-16 ...
Read more >
37 Reasons why your Neural Network is not working - Slav
If your input looks like (k, H, W) = (64, 64, 64) it's easy to miss errors related to wrong dimensions. Use weird...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found