Open clemgris opened 1 year ago
Hi. Have you manage to resolve the issue?
Hi, no, the issue is still unresolved.
I think the problem here is that the bins
argument of the wrapper ends up being used in the discretize function in a way that requires it to be a static value.
So instead of a jnp.array
you could for example use a regular np.array
where you create the DiscreteActionSpaceWrapper
.
dynamics_model = dynamics.discretizer.DiscreteActionSpaceWrapper(
dynamics_model=dynamics_model,
bins=128 * np.array(action_space_dim)
)
I am currently working with the
InvertibleBicycleModel
andPlanningAgent
dynamics and environment in my project. I've encountered ajax.errors.ConcretizationTypeError
when I apply the Discrete wrapper and attempt to update the simulator state within a scan function. No error is raised when updating the simulator state within a regular loop.This issue specifically arises when the
Discrete
wrapper is applied. Removing theDiscretize
wrapper prevents the error from occurring.Reproduction Steps:
Initialisation of the dataset.
Initialisation of the environment and dynamics (apply the Discrete Wrapper) as well as an expert agent.
The loop to update the simulator state from the expert action does not raise any error.
The same loop done within a scan function raises the
jax.errors.ConcretizationTypeError
error.The Traceback of the error is: