Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 104 additions & 80 deletions README.md

Large diffs are not rendered by default.

13 changes: 4 additions & 9 deletions internnav/agent/internvla_n1_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def s2_thread_func():
self.s2_thread.daemon = True
self.s2_thread.start()

def should_infer_s2(self, mode="sync"):
def should_infer_s2(self, mode="partial_async"):
"""Function: Enables the sys2 inference thread depending on the mode.
mode: just support 2 modes: "sync" and "partial_async".
"sync": Synchronous mode (navdp_version >= 0.0), Sys1 and Sys2 execute in a sequential inference chain.
Expand Down Expand Up @@ -298,8 +298,6 @@ def step(self, obs):
if self.sys1_infer_times > 0:
self.dual_forward_step += 1

# print('Output action:', output, self.dual_forward_step)

else:
self.look_down = False
# 2. If output is in latent form, execute latent S1
Expand Down Expand Up @@ -333,13 +331,9 @@ def step(self, obs):
.unsqueeze(-1)
.to(self.device)
) # [1, 2, 224, 224, 1]
self.s1_output = self.policy.s1_step_latent(
rgbs, depths, self.s2_output.output_latent, use_async=True
)
self.s1_output = self.policy.s1_step_latent(rgbs, depths, self.s2_output.output_latent)
else:
self.s1_output = self.policy.s1_step_latent(
rgb, depth * 10000.0, self.s2_output.output_latent, use_async=False
)
self.s1_output = self.policy.s1_step_latent(rgb, depth * 10000.0, self.s2_output.output_latent)

else:
assert False, f"S2 output should be either action or latent, but got neither! {self.s2_output}"
Expand Down Expand Up @@ -372,6 +366,7 @@ def step(self, obs):
if self.dual_forward_step > self.sys2_max_forward_step:
print("!!!!!!!!!!!!")
print("ERR: self.dual_forward_step ", self.dual_forward_step, " > ", self.sys2_max_forward_step)
print("Potential reason: sys1 infers empty trajectory list []")
print("!!!!!!!!!!!!")

print('Output discretized traj:', output['action'], self.dual_forward_step)
Expand Down
Loading