Improbable-AI / walk-these-ways

Sim-to-real RL training and deployment tools for the Unitree Go1 robot.
https://gmargo11.github.io/walk-these-ways/
Other
492 stars 129 forks source link

when delopy - “make autostart” failed, show “cannot import name ‘DeploymentRunner“ #24

Closed kanghua309 closed 1 year ago

kanghua309 commented 1 year ago

unitree@unitree-desktop:~/go1_gym/go1_gym_deploy/autostart$ cd ~/go1_gym/go1_gym_deploy/docker unitree@unitree-desktop:~/go1_gym/go1_gym_deploy/docker$ sudo make autostart make: Warning: File ‘Makefile’ has modification time 51435344 s in the future docker stop foxy_controller || true Error response from daemon: No such container: foxy_controller docker rm foxy_controller || true Error: No such container: foxy_controller docker run -d\ --env=“DISPLAY” \ --env=“QT_X11_NO_MITSHM=1" \ --volume=“/tmp/.X11-unix:/tmp/.X11-unix:rw” \ --env=“XAUTHORITY=” \ --volume=“:” \ --volume=“/home/unitree/go1_gym:/home/isaac/go1_gym” \ --privileged \ --runtime=nvidia \ --net=host \ --workdir=“/home/isaac/go1_gym” \ --name=“foxy_controller” \ jetson-model-deployment tail -f /dev/null 0578640c8df46a393abd625e7900b766944f04fabb9f825bafa90dd77c14a2c9 docker start foxy_controller foxy_controller docker exec foxy_controller bash -c ‘cd /home/isaac/go1_gym/ && python3 setup.py install && cd go1_gym_deploy/scripts && ls && python3 deploy_policy.py’ running install running bdist_egg running egg_info writing go1_gym.egg-info/PKG-INFO writing dependency_links to go1_gym.egg-info/dependency_links.txt writing top-level names to go1_gym.egg-info/top_level.txt reading manifest file ‘go1_gym.egg-info/SOURCES.txt’ writing manifest file ‘go1_gym.egg-info/SOURCES.txt’ installing library code to build/bdist.linux-aarch64/egg running install_lib running build_py creating build/bdist.linux-aarch64/egg creating build/bdist.linux-aarch64/egg/go1_gym_deploy creating build/bdist.linux-aarch64/egg/go1_gym_deploy/utils copying build/lib/go1_gym_deploy/utils/network_config_unitree.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils copying build/lib/go1_gym_deploy/utils/deployment_runner.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils copying build/lib/go1_gym_deploy/utils/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils copying build/lib/go1_gym_deploy/utils/logger.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils copying build/lib/go1_gym_deploy/utils/command_profile.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils copying build/lib/go1_gym_deploy/utils/cheetah_state_estimator.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils creating build/bdist.linux-aarch64/egg/go1_gym_deploy/envs copying build/lib/go1_gym_deploy/envs/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/envs copying build/lib/go1_gym_deploy/envs/lcm_agent.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/envs copying build/lib/go1_gym_deploy/envs/history_wrapper.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/envs copying build/lib/go1_gym_deploy/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy creating build/bdist.linux-aarch64/egg/go1_gym_deploy/tests copying build/lib/go1_gym_deploy/tests/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/tests copying build/lib/go1_gym_deploy/tests/check_camera_msgs.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/tests copying build/lib/go1_gym_deploy/setup.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy creating build/bdist.linux-aarch64/egg/go1_gym_deploy/scripts copying build/lib/go1_gym_deploy/scripts/deploy_policy.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/scripts copying build/lib/go1_gym_deploy/scripts/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/scripts creating build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/camera_message_rect_wide.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/rc_command_lcmt.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/camera_message_lcmt.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/leg_control_data_lcmt.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/pd_tau_targets_lcmt.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types copying build/lib/go1_gym_deploy/lcm_types/state_estimator_lcmt.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types creating build/bdist.linux-aarch64/egg/go1_gym_deploy/unitree_legged_sdk_bin copying build/lib/go1_gym_deploy/unitree_legged_sdk_bin/init.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/unitree_legged_sdk_bin byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/network_config_unitree.py to network_config_unitree.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/deployment_runner.py to deployment_runner.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/logger.py to logger.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/command_profile.py to command_profile.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/cheetah_state_estimator.py to cheetah_state_estimator.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/envs/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/envs/lcm_agent.py to lcm_agent.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/envs/history_wrapper.py to history_wrapper.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/tests/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/tests/check_camera_msgs.py to check_camera_msgs.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/setup.py to setup.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/scripts/deploy_policy.py to deploy_policy.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/scripts/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/camera_message_rect_wide.py to camera_message_rect_wide.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/rc_command_lcmt.py to rc_command_lcmt.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/camera_message_lcmt.py to camera_message_lcmt.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/leg_control_data_lcmt.py to leg_control_data_lcmt.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/init.py to init.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/pd_tau_targets_lcmt.py to pd_tau_targets_lcmt.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/lcm_types/state_estimator_lcmt.py to state_estimator_lcmt.cpython-36.pyc byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/unitree_legged_sdk_bin/init.py to init.cpython-36.pyc creating build/bdist.linux-aarch64/egg/EGG-INFO copying go1_gym.egg-info/PKG-INFO -> build/bdist.linux-aarch64/egg/EGG-INFO copying go1_gym.egg-info/SOURCES.txt -> build/bdist.linux-aarch64/egg/EGG-INFO copying go1_gym.egg-info/dependency_links.txt -> build/bdist.linux-aarch64/egg/EGG-INFO copying go1_gym.egg-info/top_level.txt -> build/bdist.linux-aarch64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating ‘dist/go1_gym-1.0.0-py3.6.egg’ and adding ‘build/bdist.linux-aarch64/egg’ to it removing ‘build/bdist.linux-aarch64/egg’ (and everything under it) Processing go1_gym-1.0.0-py3.6.egg Copying go1_gym-1.0.0-py3.6.egg to /usr/local/lib/python3.6/dist-packages Adding go1-gym 1.0.0 to easy-install.pth file Installed /usr/local/lib/python3.6/dist-packages/go1_gym-1.0.0-py3.6.egg Processing dependencies for go1-gym==1.0.0 Finished processing dependencies for go1-gym==1.0.0 init.py deploy_policy.py deployment_image.tar send_to_unitree.sh Traceback (most recent call last): File “deploy_policy.py”, line 6, in from go1_gym_deploy.utils.deployment_runner import DeploymentRunner ImportError: cannot import name ‘DeploymentRunner’ Makefile:23: recipe for target ‘autostart’ failed make: *** [autostart] Error 1

gmargo11 commented 1 year ago

Hi @kanghua309 ,

The DeploymentRunner is defined here: https://github.com/Improbable-AI/walk-these-ways/blob/master/go1_gym_deploy/utils/deployment_runner.py

Your output from sudo make autostart indicates it is being installed correctly inside docker per these lines:

copying build/lib/go1_gym_deploy/utils/deployment_runner.py -> build/bdist.linux-aarch64/egg/go1_gym_deploy/utils
...
byte-compiling build/bdist.linux-aarch64/egg/go1_gym_deploy/utils/deployment_runner.py to deployment_runner.cpython-36.pyc

So, I am not sure why the error is occurring.

One way to debug is you can instead enter the docker container in interactive mode: instead of sudo make autostart, type sudo make run which will open an interactive session inside the docker container. Then manually execute the following commands:

python3 setup.py develop
cd go1_gym_deploy/scripts
python3 deploy_policy.py

Then, check if the output is the same. If the error still occurs, you can debug interactively by opening a python shell, testing other imports, etc

-Gabe