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
898 stars 315 forks source link

support pytorch v0.4 #25

Closed Kelvinson closed 5 years ago

Kelvinson commented 5 years ago

A not-thorough migration to support pytorch>= 0.4, solve issue 12, includes:

  1. use with torch.no_grad() to solve the gpu memory issue
  2. loss.item() to solve the "indexing 0-dimension" problem

As @st2yang pointed out here, it can still use the provided trained weights.

A more thorough migration is on my branch, but it needs training from scratch and there is nan error.

Note the both of two branches only work for V-REP 3.5. A hack around to adapt V3.6 is welcome. Have fun!