waymax icon indicating copy to clipboard operation
waymax copied to clipboard

All attempts to get a Google authentication bearer token failed

Open cjybupt opened this issue 1 year ago • 2 comments

I have already gotten the access to Waymo Open Motion Dataset. However, when I run the demo like `import jax from jax import numpy as jnp import numpy as np import mediapy from tqdm import tqdm import dataclasses

from waymax import config as _config from waymax import dataloader from waymax import datatypes from waymax import dynamics from waymax import env as _env from waymax import agents from waymax import visualization

Config dataset:

max_num_objects = 32

config = dataclasses.replace(_config.WOD_1_0_0_VALIDATION, max_num_objects=max_num_objects) data_iter = dataloader.simulator_state_generator(config=config) scenario = next(data_iter)

Config the multi-agent environment:

init_steps = 11

Set the dynamics model the environment is using.

Note each actor interacting with the environment needs to provide action

compatible with this dynamics model.

dynamics_model = dynamics.StateDynamics()

Expect users to control all valid object in the scene.

env = _env.MultiAgentEnvironment( dynamics_model=dynamics_model, config=dataclasses.replace( _config.EnvironmentConfig(), max_num_objects=max_num_objects, controlled_object=_config.ObjectType.VALID, ), )

Setup a few actors, see visualization below for how each actor behaves.

An actor that doesn't move, controlling all objects with index > 4

obj_idx = jnp.arange(max_num_objects) static_actor = agents.create_constant_speed_actor( speed=0.0, dynamics_model=dynamics_model, is_controlled_func=lambda state: obj_idx > 4, )

IDM actor/policy controlling both object 0 and 1.

Note IDM policy is an actor hard-coded to use dynamics.StateDynamics().

actor_0 = agents.IDMRoutePolicy( is_controlled_func=lambda state: (obj_idx == 0) | (obj_idx == 1) )

Constant speed actor with predefined fixed speed controlling object 2.

actor_1 = agents.create_constant_speed_actor( speed=5.0, dynamics_model=dynamics_model, is_controlled_func=lambda state: obj_idx == 2, )

Exper/log actor controlling objects 3 and 4.

actor_2 = agents.create_expert_actor( dynamics_model=dynamics_model, is_controlled_func=lambda state: (obj_idx == 3) | (obj_idx == 4), )

actors = [static_actor, actor_0, actor_1, actor_2]

jit_step = jax.jit(env.step) jit_select_action_list = [jax.jit(actor.select_action) for actor in actors]

states = [env.reset(scenario)] for _ in range(states[0].remaining_timesteps): current_state = states[-1]

outputs = [ jit_select_action({}, current_state, None, None) for jit_select_action in jit_select_action_list ] action = agents.merge_actions(outputs) next_state = jit_step(current_state, action)

states.append(next_state)

imgs = [] for state in states: imgs.append(visualization.plot_simulator_state(state, use_log_traj=False)) mediapy.show_video(imgs, fps=10)`

I got this error All attempts to get a Google authentication bearer token failed, returning an empty token. Retrieving token from files failed with "NOT_FOUND: Could not locate the credentials file.". Retrieving token from GCE failed with "FAILED_PRECONDITION: Error executing an HTTP request: libcurl code 6 meaning 'Couldn't resolve host name', error details: Could not resolve host: metadata.google.internal". Traceback (most recent call last):

It would be great if you can help me out there! Thx

cjybupt avatar Oct 31 '23 07:10 cjybupt