dynalang icon indicating copy to clipboard operation
dynalang copied to clipboard

Array instead of int in self.obs_space

Open BurgerAndreas opened this issue 1 year ago • 0 comments

Reproduce the error

TASK=homegrid_task; EXP_NAME=first_run; GPU_IDS=0; SEED=0
sh scripts/run_homegrid.sh $TASK $EXP_NAME $GPU_IDS $SEED

Encounters the error

ValueError: Non-hashable static arguments are not supported. 
An error occurred during a call to '_one_hot' while trying to hash an object of type <class 'numpy.ndarray'>, 32100. 
The error was:
TypeError: unhashable type: 'numpy.ndarray'

Hacky fix

A small fix in dynalang/dynalang/agent.py:142 worked for me

# value = jax.nn.one_hot(value, self.obs_space[key].high) # before
value = jax.nn.one_hot(value, int(self.obs_space[key].high)) # fixed

But maybe the type of self.obs_space[key].high should be changed in the dictionary?

BurgerAndreas avatar Nov 17 '23 23:11 BurgerAndreas