Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misconfigured parameter num_action_ch for action_cond_predrnn_v2 #32

Closed
Flunzmas opened this issue Feb 8, 2022 · 2 comments
Closed

Comments

@Flunzmas
Copy link

Flunzmas commented Feb 8, 2022

Hi there,

I am having issues using the action-conditional PredRNNV2 for inference.

The way it seems to work (action_injection=concat): Load the actions, grid-repeat them and concat the actual video data and the resulting action tensor channel-wise. Then, use reshape_patch() and pass the input to the model, resulting in a tensor of shape [batch, seq_length, height // patch_size, width // patch_size, (img_ch + action_ch) * patch_size ** 2].

For the action-conditional PredRNNV2 model however, the parameter num_action_ch is used directly for the input channels for the conv layers instead of num_action_ch * patch_size ** 2. For me, this leads to runtime shape mismatches in forward(). Is this an error or did I get it wrong somehow?

@wuhaixu2016
Copy link
Member

Hi,

(1) num_action_ch is equal to the dimension of actions. We expand the action to the size of (height // patch_size, width // patch_size).
(2)the repatch_back is only conducted on the frame. See line135-137 in ./core/models/action_cond_predrnn_v2.py

@Flunzmas
Copy link
Author

Thanks for the quick answer!

I see where I thought wrong: For the action-conditional case, the expanded action is concatenated to the frames after reshape_patch() / stripped from the result before reshape_patch_back().
I have looked at the shape returned e.g. in core/data_provider/bair.py and thought that we include the actions in the input to reshape_patch().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants