papagina / RotationContinuity

Coder for "On the Continuity of Rotation Representations"
MIT License
328 stars 54 forks source link

errors in sanitycheck train.py #10

Open fenaux opened 2 years ago

fenaux commented 2 years ago

Hi,

I am very interested in your work and try to reproduce it

I notice these errors in sanity_test/code/train.py

print ("################TEST ON Rodriguez-vectors, input=r_matrix, loss=geodesic#####################") model_rmg = Model(is_linear=False, out_rotation_mode="Rodriguez-vectors") train(model_emg, input_mode = "r_matrix", loss_mode="geodesic", sampling_method="quaternion",batch=64 , total_iter=500001, out_weight_folder=out_weight_folder+"rmg/")

model should be model_rmg

print ("################TEST ON euler_sin_cos, input=r_matrix, loss=geodesic#####################") model_escmg = Model(is_linear=False, out_rotation_mode="euler_sin_cos") train(model_emg, input_mode = "r_matrix", loss_mode="geodesic", sampling_method="axis_angle",batch=64 , total_iter=500001, out_weight_folder=out_weight_folder+"escmg/")

model should be model_escmg

print ("################TEST ON Quaternion_half, input=r_matrix, loss=geodesic#####################") model_qhmp = Model(is_linear=False, out_rotation_mode="Quaternion_half") train(model_emg, input_mode = "r_matrix", loss_mode="pose", sampling_method="quaternion",batch=64 , total_iter=500001, out_weight_folder=out_weight_folder+"qhmp/") model_qhmg = Model(is_linear=False, out_rotation_mode="Quaternion_half") train(model_emg, input_mode = "r_matrix", loss_mode="geodesic", sampling_method="quaternion",batch=64 , total_iter=500001, out_weight_folder=out_weight_folder+"qhmg/")

model should be model_qhmg

I run train.py after these modifications training with loss = pose ran without problem

for all the cases with loss = geodesic after fzx iterations I got loss is NaN

please see issue with geodesic loss

Frank-ZY-Dou commented 1 month ago

The current computation is not that robust and could cause Nan error. Try this manner: https://pytorch3d.readthedocs.io/en/latest/modules/transforms.html#pytorch3d.transforms.so3_relative_angle