stepjam / PyRep

A toolkit for robot learning research.
MIT License
689 stars 164 forks source link

crash when using pytorch #243

Closed superggb closed 3 years ago

superggb commented 3 years ago

Hello: I'm doing reinforcement experiment based on the example env script env_example . However when I created the environment and used reset() method then went to some pytorch codes , it crashed with some error as below:


/home/ggb/CoppeliaSim_Edu_V4_1_0_Ubuntu16_04/libcoppeliaSim.so.1(_Z11_segHandleri+0x28)[0x7fd1be15d0b8]
/lib/x86_64-linux-gnu/libc.so.6(+0x354c0)[0x7fd1d6cd54c0]
/home/ggb/miniconda3/envs/vrep/lib/python3.6/site-packages/torch/lib/libtorch_python.so(+0x721d28)[0x7fd1ab110d28]
/home/ggb/miniconda3/envs/vrep/lib/python3.6/site-packages/torch/lib/libtorch_python.so(+0x5c731f)[0x7fd1aafb631f]
/home/ggb/miniconda3/envs/vrep/lib/python3.6/site-packages/torch/lib/libtorch_python.so(+0x71d6ef)[0x7fd1ab10c6ef]
/home/ggb/miniconda3/envs/vrep/lib/python3.6/site-packages/torch/lib/libtorch_python.so(+0x2c40a0)[0x7fd1aacb30a0]
python(_PyCFunction_FastCallDict+0x154)[0x55672d0a4a14]
python(+0x19aa5c)[0x55672d12ca5c]
python(_PyEval_EvalFrameDefault+0x30a)[0x55672d14f25a]
python(_PyFunction_FastCallDict+0x11b)[0x55672d12728b]
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

Something I want to mention is that I use conda environment and installed pytorch,tensorflow,baselines before. Before this error there is another error which told me the qt path is in the cv2 not in CoppeliaSim may because some imported library. I solved this by code below to change qt_path: '/home/ggb/miniconda3/envs/vrep/lib/python3.6/site-packages/cv2/qt/plugins' to:

os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = /home/ggb/CoppeliaSim_Edu_V4_1_0_Ubuntu16_04

I don't know if this change will affect pytorch. I think maybe there are some conflicts such as threads between pyrep agent and my RL code. But I can't figure it out. So what's the problem?

BTW I used RL code modified from some gym envs, any differences should I notice?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.