Merge branch 'main' of github.com:MarkFzp/act-plus-plus into main
这个提交包含在:
@ -198,7 +198,7 @@ def eval_bc(config, ckpt_name, save_episode=True):
|
|||||||
if real_robot:
|
if real_robot:
|
||||||
from aloha_scripts.robot_utils import move_grippers # requires aloha
|
from aloha_scripts.robot_utils import move_grippers # requires aloha
|
||||||
from aloha_scripts.real_env import make_real_env # requires aloha
|
from aloha_scripts.real_env import make_real_env # requires aloha
|
||||||
env = make_real_env(init_node=True, setup_base=True)
|
env = make_real_env(init_node=True, setup_robots=True, setup_base=True)
|
||||||
env_max_reward = 0
|
env_max_reward = 0
|
||||||
else:
|
else:
|
||||||
from sim_env import make_sim_env
|
from sim_env import make_sim_env
|
||||||
@ -212,7 +212,7 @@ def eval_bc(config, ckpt_name, save_episode=True):
|
|||||||
|
|
||||||
max_timesteps = int(max_timesteps * 1) # may increase for real-world tasks
|
max_timesteps = int(max_timesteps * 1) # may increase for real-world tasks
|
||||||
|
|
||||||
num_rollouts = 50
|
num_rollouts = 1
|
||||||
episode_returns = []
|
episode_returns = []
|
||||||
highest_rewards = []
|
highest_rewards = []
|
||||||
for rollout_id in range(num_rollouts):
|
for rollout_id in range(num_rollouts):
|
||||||
@ -233,7 +233,7 @@ def eval_bc(config, ckpt_name, save_episode=True):
|
|||||||
|
|
||||||
### evaluation loop
|
### evaluation loop
|
||||||
if temporal_agg:
|
if temporal_agg:
|
||||||
all_time_actions = torch.zeros([max_timesteps, max_timesteps+num_queries, state_dim]).cuda()
|
all_time_actions = torch.zeros([max_timesteps, max_timesteps+num_queries, 16]).cuda()
|
||||||
|
|
||||||
qpos_history = torch.zeros((1, max_timesteps, state_dim)).cuda()
|
qpos_history = torch.zeros((1, max_timesteps, state_dim)).cuda()
|
||||||
image_list = [] # for visualization
|
image_list = [] # for visualization
|
||||||
@ -271,6 +271,7 @@ def eval_bc(config, ckpt_name, save_episode=True):
|
|||||||
vq_sample = latent_model.generate(1, temperature=1, x=None)
|
vq_sample = latent_model.generate(1, temperature=1, x=None)
|
||||||
all_actions = policy(qpos, curr_image, vq_sample=vq_sample)
|
all_actions = policy(qpos, curr_image, vq_sample=vq_sample)
|
||||||
else:
|
else:
|
||||||
|
# e()
|
||||||
all_actions = policy(qpos, curr_image)
|
all_actions = policy(qpos, curr_image)
|
||||||
if temporal_agg:
|
if temporal_agg:
|
||||||
all_time_actions[[t], t:t+num_queries] = all_actions
|
all_time_actions[[t], t:t+num_queries] = all_actions
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户