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

ValueError: Input scale must be a Bx2 tensor. Got torch.Size([16]) #3

Open
linden713 opened this issue Dec 9, 2021 · 2 comments
Open

Comments

@linden713
Copy link

When the exploration is done and begin to Model Train I counter the following errors
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/transition_model.py", line 784, in forward
rotation_matrix = kornia.geometry.transform.get_rotation_matrix2d(center, delta_theta, scale).to(device)
File "/home/lch/.local/lib/python3.6/site-packages/kornia/geometry/transform/imgwarp.py", line 346, in get_rotation_matrix2d
raise ValueError(f"Input scale must be a Bx2 tensor. Got {scale.shape}")
ValueError: Input scale must be a Bx2 tensor. Got torch.Size([16])

I thought is was due to the different version of kornia and torch, because i have change some functional call in kornia to fix some errors. So i would appreciate it if you could tell we what version can run the code.
PS: I was using torch 1.10.0 and kornia 0.6.1

@YuxiangCui
Copy link
Collaborator

I was using torch 1.7.1+cu101 and kornia 0.5.0. It seems that the kornia has got updated in the latest versions in some functional call, maybe that are the reasons for the errors. We may use kornia of the new versions in our later work, please focus on our lab's works if you are interested.

@linden713
Copy link
Author

Still not working. I will try another way.
======================> Exploration Done <======================
========> Model Train <========
Traceback (most recent call last):
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/main_four.py", line 469, in
main()
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/main_four.py", line 465, in main
train(env_sampler, predict_env, policy, env_pool, model_pool)
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/main_four.py", line 99, in train
train_predict_model(env_pool, predict_env, True)
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/main_four.py", line 282, in train_predict_model
predict_env.model.train(state, action, next_state, reward, batch_size=BATCH_SIZE_MODEL)
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/ensemble_model.py", line 141, in train
model.generator(state_input, images_pre, transformations_pre, num_pre, action)
File "/home/lch/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/lch/model-based-social-navigation/src/model_based_version/scripts/transition_model.py", line 784, in forward
rotation_matrix = kornia.get_rotation_matrix2d(center, delta_theta, scale).to(device)
File "/home/lch/.local/lib/python3.6/site-packages/kornia/geometry/transform/imgwarp.py", line 402, in get_rotation_matrix2d
.format(scale.shape))
ValueError: Input scale must be a Bx2 tensor. Got torch.Size([16])

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