MarkFzp / act-plus-plus

Imitation learning algorithms with Co-training for Mobile ALOHA: ACT, Diffusion Policy, VINN
https://mobile-aloha.github.io/
MIT License
2.86k stars 525 forks source link

Lack of image normalization in DiffusionPolicy #48

Open hesic73 opened 3 months ago

hesic73 commented 3 months ago

In policy.py, image normalization is applied in both ACTPolicy and CNNMLPPolicy as follows:

        normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                         std=[0.229, 0.224, 0.225])
        image = normalize(image)

However, this normalization step is missing in DiffusionPolicy. Is this omission intentional? Could you clarify the reasoning behind this difference?

woltium commented 1 week ago

In policy.py, image normalization is applied in both ACTPolicy and CNNMLPPolicy as follows:

        normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                         std=[0.229, 0.224, 0.225])
        image = normalize(image)

However, this normalization step is missing in DiffusionPolicy. Is this omission intentional? Could you clarify the reasoning behind this difference?

@hesic73 same question,and whether the normalization is added or not, the final eval performance of Diffusion policy is poor,arms keeps shaking and can't complete the task. Have you solved this problem?

QueirosJustin commented 1 week ago

@woltium Hello, How did Diffusion Policy even run for you? Even after following all the instructions I get an error until I turn off ENABLE_EMA = True in policy.py to false. Once I do this though, I receive " raise _control.PhysicsError(message) dm_control.rl.control.PhysicsError: Physics state is invalid. Warning(s) raised: mjWARN_BADQACC" everytime during the first evaluation. For ACT everything is working fine for me. I would appreciate an answer a lot.

QueirosJustin commented 1 week ago

@woltium I used this command: python3 imitate_episodes.py --task_name sim_transfer_cube_scripted --ckpt_dir /home/Desktop/learning --policy_class Diffusion --chunk_size 32 --batch_size 32 --lr 1e-5 --seed 0 --num_steps 100000 --eval_every 2000 --validate_every 2000 --save_every 2000