fan-ziqi / rl_sar

Simulation verification and physical deployment of robot reinforcement learning algorithms, suitable for quadruped robots, wheeled robots, and humanoid robots. "sar" stands for "simulation and real"
Apache License 2.0
164 stars 17 forks source link

Abandoned (core has been dumped) #3

Closed hanzhi0410 closed 4 months ago

hanzhi0410 commented 5 months ago

Hello author, when using your deployment plan, you often encounter the following problems by chance ######### terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc ##########

May I ask if you have encountered any good solutions during use

fan-ziqi commented 5 months ago

Please use gdb to debug the program and reply with specific errors

hanzhi0410 commented 4 months ago

Thank you for your reply. I added torch:: autograd:: GradMode:: set_enabled (false); Solved the problem.

fan-ziqi commented 4 months ago

Maybe you didn't pull the latest version, this issue has been fixed in 81fa87035a512f2eeaac079bd35a256ffef7d413

hanzhi0410 commented 4 months ago

It may be an issue with my model, and I also need to add torch:: autograd:: GradMode:: set_enabled (false) in torch:: Tensor RL_Sim:: Forward(); Like this: Torch:: Tensor RL_Sim:: Forward() { Torch:: autograd:: GradMode:: set_enabled (false); Torch:: Tensor action=this ->model. forward ({this ->unobsbuffer_tensor}). toTensor(); This ->obs. actions=action; Torch:: Tensor clamped=Torch:: clamp (action, - this ->params. clip.actions, this ->params. clip.actions); Return clamped; }