ocs2 icon indicating copy to clipboard operation
ocs2 copied to clipboard

Run train.py in ocs2_ballbot_mpcnet but stuck at waiting for the first data

Open EricTonyLiu opened this issue 1 year ago • 14 comments

Describe the bug I set up and install all the dependency of MPC-Net and then i run the train.py in ocs2_ballbot_mpcnet, it seems everything goes well but the program stuck at waiting for the first data, i dont know whether should i launch another file such as an simulation enviroment?

To Reproduce Steps to reproduce the behavior:

  1. Go to '~/osc2_ws/src/ocs2/ocs2_mpcnet/ocs2_ballbot_mpcnet/python/ocs2_ballbot_mpcnet
  2. Run train,py
  3. The program stuck at here

Screenshots

[CppAdInterface] Loading Shared Library: /home/rmua1/osc2_ws/src/ocs2/ocs2_robotic_examples/ocs2_ballbot/auto_generated/ballbot_dynamics_flow_map/cppad_generated/ballbot_dynamics_flow_map_lib.so [CppAdInterface] Loading Shared Library: /home/rmua1/osc2_ws/src/ocs2/ocs2_robotic_examples/ocs2_ballbot/auto_generated/ballbot_dynamics_jump_map/cppad_generated/ballbot_dynamics_jump_map_lib.so [CppAdInterface] Loading Shared Library: /home/rmua1/osc2_ws/src/ocs2/ocs2_robotic_examples/ocs2_ballbot/auto_generated/ballbot_dynamics_guard_surfaces/cppad_generated/ballbot_dynamics_guard_surfaces_lib.so

Rollout Settings:

=============================================================================

'AbsTolODE'..........................................................1e-05

'RelTolODE'..........................................................0.001

'maxNumStepsPerSecond'..............................................100000

'timeStep'............................................................0.01

'integratorType'.....................................................ODE45 (default)

'checkNumericalStability'................................................0

'reconstructInputTrajectory'.............................................1 (default)

'rootFindingAlgorithm'...................................................0 (default)

'maxSingleEventIterations'..............................................10 (default)

'useTrajectorySpreadingController'.......................................0 (default)

=============================================================================

============== Waiting for first data.

Additional context I think the data-generation is failed but i dont know how to fix it

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/rmua1/osc2_ws/src/ocs2/ocs2_mpcnet/ocs2_ballbot_mpcnet/python/ocs2_ballbot_mpcnet/train.py", line 71, in main(root_dir, "ballbot.yaml") File "/home/rmua1/osc2_ws/src/ocs2/ocs2_mpcnet/ocs2_ballbot_mpcnet/python/ocs2_ballbot_mpcnet/train.py", line 63, in main mpcnet.train() File "/home/rmua1/osc2_ws/src/ocs2/ocs2_mpcnet/ocs2_mpcnet_core/python/ocs2_mpcnet_core/mpcnet.py", line 328, in train time.sleep(1.0) KeyboardInterrupt

In "/home/rmua1/osc2_ws/src/ocs2/ocs2_mpcnet/ocs2_mpcnet_core/python/ocs2_mpcnet_core/mpcnet.py

EricTonyLiu avatar Mar 12 '23 13:03 EricTonyLiu

Hi @EricTonyLiu, I just did a new setup following these instructions:

  • https://leggedrobotics.github.io/ocs2/installation.html#doxid-ocs2-doc-installation
  • https://leggedrobotics.github.io/ocs2/mpcnet.html

And it work on my machine. Can you please double-check if you exactly followed all of those instructions? Also, can you try deploying the default policy with roslaunch ocs2_ballbot_mpcnet ballbot_mpcnet.launch?

areske avatar Mar 12 '23 21:03 areske

Thank you for your replyment. Yes, i followed the step and install the ocs2 and raisim, the other example such as ocs2_quadrotor works fine to me, i ran roslaunch ocs2_ballbot_mpcnet ballbot_mpcnet.launch, the default policy deployment also works fine my virtual environment is annaconda rather than vens, i dont know whether this needs other setup, at first the environment cannot find the python package like the ocs2-mpcnet_core so i export the python path, then i can run the train.py, but still stuck at Waiting for first data. maybe someone can tell me whether the data come from so i can debug it? thanks a lot

EricTonyLiu avatar Mar 13 '23 03:03 EricTonyLiu

I am facing the same issue. Installed everything following the documentation. Default policy works fine too. On running train.py, the parameters are printed in the terminal 3 times for some reason and finally shows "waiting for 1st data"

SarveshS325 avatar Apr 24 '23 09:04 SarveshS325

@SarveshS325 What are you using for creating the virtual environment?

areske avatar May 04 '23 18:05 areske

I used venv to create the virtual environment with access to the system python. I also had to install onnx with pip in the virtual environment in addition to the steps mentioned in the documentation.

SarveshS325 avatar May 07 '23 03:05 SarveshS325

@EricTonyLiu and @SarveshS325 Can you please send me the output when you type sudo apt list --installed | grep pybind in the terminal?

areske avatar May 10 '23 20:05 areske

ros-noetic-pybind11-catkin/focal,now 2.10.3-2focal.20230213.204608 amd64 [installed,automatic]. It's the one installed along with ROS

SarveshS325 avatar May 11 '23 10:05 SarveshS325

Aha, I suspect that it might break with the newest pybind version. Can you add this version to your workspace and try again? git clone [email protected]:wxmerkt/pybind11_catkin.git -b 2.5.0

areske avatar May 11 '23 11:05 areske

Did a clean build with versions 2.5.0 and 2.4.3 pybind. Doesn't change anything

SarveshS325 avatar May 12 '23 04:05 SarveshS325

To be sure that it doesn't fix it, did you remove the globally installed package, e.g. sudo apt purge ros-noetic-pybind11-catkin?

areske avatar May 12 '23 18:05 areske

That should make no difference because I am replacing it the workspace

SarveshS325 avatar May 14 '23 11:05 SarveshS325

I am currently in the same situation having the same problem: I have followed the installation guide, adding only the installation of onnx through pip install, and the execution of train.py is stuck on "waiting for first data". Has someone found a solution so far?

Toto-0 avatar Jul 02 '23 23:07 Toto-0

I am currently in the same situation having the same problem: I have followed the installation guide, adding only the installation of onnx through pip install, and the execution of train.py is stuck on "waiting for first data". Has someone found a solution so far?

I have the same problem too @rubengrandia may we have some suggestions please? CC: @Toto-0

STaliani avatar Aug 23 '23 17:08 STaliani

I have the same problems like you. when I execute the train.py, it always stuck on "waiting for the first data". Has someone found a solution now? @Toto-0 @STaliani

Knight-xiao avatar Mar 12 '24 02:03 Knight-xiao