Skip to content

Commit fb1d2a5

Browse files
kellyisskew6688
authored andcommitted
[Feature] Add training code for InternVLA-N1 (#184)
* [feat] Add training code for InternVLA-N1 * merge refactored evaluator with decoupled system2/dual_system eval * update unused code; update setup.py and requirements for dtw * update requirements * update diffuser version * test r2r, fix import utils * update ndtw json path * test rxr * fix internvla_n1_policy with new model updates; remove use_async flag in generate_traj * update README.md * fix some typos * Minor code cleanup * remove unused code * rename dataset * reorganize trainer structure * fix a bug in reorganization --------- Co-authored-by: wangyukai <[email protected]> Co-authored-by: Yukai Wang <[email protected]>
1 parent 7128121 commit fb1d2a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4635
-1325
lines changed

README.md

Lines changed: 104 additions & 80 deletions
Large diffs are not rendered by default.

internnav/agent/internvla_n1_agent.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def s2_thread_func():
207207
self.s2_thread.daemon = True
208208
self.s2_thread.start()
209209

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

301-
# print('Output action:', output, self.dual_forward_step)
302-
303301
else:
304302
self.look_down = False
305303
# 2. If output is in latent form, execute latent S1
@@ -333,13 +331,9 @@ def step(self, obs):
333331
.unsqueeze(-1)
334332
.to(self.device)
335333
) # [1, 2, 224, 224, 1]
336-
self.s1_output = self.policy.s1_step_latent(
337-
rgbs, depths, self.s2_output.output_latent, use_async=True
338-
)
334+
self.s1_output = self.policy.s1_step_latent(rgbs, depths, self.s2_output.output_latent)
339335
else:
340-
self.s1_output = self.policy.s1_step_latent(
341-
rgb, depth * 10000.0, self.s2_output.output_latent, use_async=False
342-
)
336+
self.s1_output = self.policy.s1_step_latent(rgb, depth * 10000.0, self.s2_output.output_latent)
343337

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

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

0 commit comments

Comments
 (0)