andyzeng / visual-pushing-grasping

Train robotic agents to learn to plan pushing and grasping actions for manipulation with deep reinforcement learning.
http://vpg.cs.princeton.edu/
BSD 2-Clause "Simplified" License
915 stars 313 forks source link

can i solve cuda memory problem by setting densenet121.grad to be zero? #89

Open papercut-linkin opened 2 years ago

papercut-linkin commented 2 years ago

I read about the paper and try to reproduce the simulation but cuda memory always haunts me. I try to add

   for p1 in self.push_color_trunk.parameters():
            p1.requires_grad = False
        for p2 in self.push_depth_trunk.parameters():
            p2.requires_grad = False
        for p3 in self.grasp_color_trunk.parameters():
            p3.requires_grad = False
        for p4 in self.grasp_depth_trunk.parameters():
            p4.requires_grad = False

to reduce calculating this actually works, the code can run now. But can somebody tell me whether this is right? cuz I'm not sure if this modification will destroy the training process