目前在研究mobile aloha的训练算法部分,运行文件为imitate_episodes.py,对应指令:
# To train ACT: python3 imitate_episodes.py --task_name mobile_imu --ckpt_dir /home/song/hjx/aloha/mobile-aloha_multi-sensor/ckpt/mobile_imu --policy_class ACT --kl_weight 80 --chunk_size 100 --hidden_dim 512 --batch_size 8 --dim_feedforward 3200 --num_epochs 8000 --lr 1e-5 --seed 0
在运行代码时遇到了报错,使用的是pycharm编辑器。报错如下:
Traceback (most recent call last):
File "/home/song/hjx/aloha/mobile-aloha_multi-sensor/act/imitate_episodes.py", line 437, in <module>
main(vars(parser.parse_args()))
File "/home/song/hjx/aloha/mobile-aloha_multi-sensor/act/imitate_episodes.py", line 42, in main
from aloha_scripts.constants import TASK_CONFIGS
File "/home/song/hjx/aloha/mobile-aloha_multi-sensor/aloha_scripts/__init__.py", line 1, in <module>
from aloha_scripts.robot_utils import *
File "/home/song/hjx/aloha/mobile-aloha_multi-sensor/aloha_scripts/robot_utils.py", line 4, in <module>
from interbotix_xs_msgs.msg import JointSingleCommand
ModuleNotFoundError: No module named 'interbotix_xs_msgs'
原因是pycharm编辑器找不到interbotix_xs_msgs这个模块。
解决方案为添加如下路径:
添加完成后的路径为:
重新run, 该报错便可解决!
另外,在运行imitate_episodes.py文件时,还遇到如下报错:
Traceback (most recent call last):
File "imitate_episodes.py", line 437, in <module>
main(vars(parser.parse_args()))
File "imitate_episodes.py", line 45, in main
num_episodes = task_config['num_episodes']
KeyError: 'num_episodes'
这个报错的原因是num_episodes没有定义出来,在如下代码段处跳入constants.py:
在对应的训练任务参数中添加:
"num_episodes": 50
重新run,该报错便可解决!
注意:act的软件训练代码与aloha_scripts硬件代码要放在同一文件夹中