ZJU-Robotics-Lab / model-based-social-navigation

Learning World Transition Model for Socially Aware Robot Navigation
57 stars 11 forks source link

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

Open linden713 opened 2 years ago

linden713 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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])