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

when run python main.py,it has error #79

Open zhanghaoboyibo opened 3 years ago

zhanghaoboyibo commented 3 years ago

Hello,while running main.py, I got some error. Any solutions or suggestions for this issue? My enviroment:ubuntu16.04 + NVIDIA GTX 960M+anaconda3+ python3.6+pytorch1.0.0+CoppeliaSim4.0. And I use the code for pytorch 1.0.0, `Connected to simulation. CUDA detected. Running with GPU acceleration. /home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torchvision/models/densenet.py:212: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaimingnormal. nn.init.kaiming_normal(m.weight.data) /home/zhb/zhb_ws/src/visual-pushing-grasping/models.py:203: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaimingnormal. nn.init.kaiming_normal(m[1].weight.data) /home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/_reduction.py:49: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead. warnings.warn(warning.format(ret)) Creating data logging session: /home/zhb/zhb_ws/src/visual-pushing-grasping/logs/2021-04-30.21:00:29

Training iteration: 0 /home/zhb/zhb_ws/src/visual-pushing-grasping/models.py:235: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. rotate_color = F.grid_sample(Variable(input_color_data, volatile=True).cuda(), flow_grid_before, mode='nearest') /home/zhb/zhb_ws/src/visual-pushing-grasping/models.py:236: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. rotate_depth = F.grid_sample(Variable(input_depth_data, volatile=True).cuda(), flow_grid_before, mode='nearest') /home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:129: UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.{} is deprecated. Use nn.functional.interpolate instead.".format(self.name)) /home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/functional.py:2423: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode)) Primitive confidence scores: 1.670718 (push), 3.414888 (grasp) Strategy: exploit (exploration probability: 0.500000) Action: grasp at (12, 103, 183) Executing: grasp at (-0.358000, -0.018000, 0.050978) Grasp successful: False Time elapsed: 20.776577

Training iteration: 1 Change detected: False (value: 258) Current reward: 0.000000 Future reward: 0.000000 Expected reward: 0.000000 + 0.500000 x 0.000000 = 0.000000 Primitive confidence scores: 1.596479 (push), 2.667503 (grasp) Strategy: exploit (exploration probability: 0.500000) Action: grasp at (6, 119, 183) Traceback (most recent call last): File "main.py", line 450, in main(args) File "main.py", line 301, in main trainer.backprop(prev_color_heightmap, prev_valid_depth_heightmap, prev_primitive_action, prev_best_pix_ind, label_value) File "/home/zhb/zhb_ws/src/visual-pushing-grasping/trainer.py", line 342, in backprop push_predictions, grasp_predictions, state_feat = self.forward(color_heightmap, depth_heightmap, is_volatile=False, specific_rotation=best_pix_ind[0]) File "/home/zhb/zhb_ws/src/visual-pushing-grasping/trainer.py", line 163, in forward output_prob, state_feat = self.model.forward(input_color_data, input_depth_data, is_volatile, specific_rotation) File "/home/zhb/zhb_ws/src/visual-pushing-grasping/models.py", line 292, in forward interm_push_color_feat = self.push_color_trunk.features(rotate_color) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torchvision/models/densenet.py", line 141, in forward new_features = super(_DenseLayer, self).forward(x) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 76, in forward exponential_average_factor, self.eps) File "/home/zhb/anaconda3/envs/work/lib/python3.6/site-packages/torch/nn/functional.py", line 1623, in batch_norm training, momentum, eps, torch.backends.cudnn.enabled RuntimeError: CUDA out of memory. Tried to allocate 5.12 MiB (GPU 0; 1.96 GiB total capacity; 1.09 GiB already allocated; 1.94 MiB free; 27.21 MiB cached) `

abdul-mannan-khan commented 3 years ago

I am having the same problem. Is there any possible solution?