Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All attempts to get a Google authentication bearer token failed #28

Open
cjybupt opened this issue Oct 31, 2023 · 2 comments
Open

All attempts to get a Google authentication bearer token failed #28

cjybupt opened this issue Oct 31, 2023 · 2 comments

Comments

@cjybupt
Copy link

cjybupt commented Oct 31, 2023

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 cjybupt closed this as completed Oct 31, 2023
@cjybupt cjybupt reopened this Oct 31, 2023
@cjybupt cjybupt closed this as completed Oct 31, 2023
@cjybupt cjybupt reopened this Oct 31, 2023
@cjybupt cjybupt closed this as completed Oct 31, 2023
@cjybupt cjybupt reopened this Oct 31, 2023
@cjybupt
Copy link
Author

cjybupt commented Oct 31, 2023

I would appreciate it if you could give me a simple demo which can run on my local machine.

@justinjfu
Copy link
Contributor

Could you try some of the steps in #30 (comment) and see if they resolve the issue? And it would be appreciated if you report back if they work so we can compile an FAQ for these access issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants