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

RuntimeError #33

Open
yeyulege opened this issue Mar 7, 2023 · 2 comments
Open

RuntimeError #33

yeyulege opened this issue Mar 7, 2023 · 2 comments

Comments

@yeyulege
Copy link

yeyulege commented Mar 7, 2023

When added the code below, I got an error:" RuntimeError: expected stride to be a single integer value or a list of 3 values to match the convolution dimensions, but got stride=[1, 1] ", does anyone tell me why this happen?

def main():

model = ConvLSTM(input_dim=3,
                 hidden_dim=[64, 64, 128, 128],
                 kernel_size=(3, 3, 3),
                 num_layers=4,
                 batch_first=True,
                 bias=True,
                 return_all_layers=False
                 )

print(model)

x = torch.randn((32, 10, 64, 128, 128))

now_states, last_states = model(x)

if name == "main":
main()

@Jiazxu
Copy link

Jiazxu commented Mar 11, 2023

Hi,

Try to set your kernel_size = ([3, 3], [3, 3], [3, 3]).

And reset the "_extend_for_multilayer" method like:

def _extend_for_multilayer(param, num_layers):
        if isinstance(param, int):
            param = [param] * num_layers
        return param

:D

@yeyulege
Copy link
Author

Thank you for your advice! That error was solved!

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