germain-hug / Deep-RL-Keras

Keras Implementation of popular Deep RL Algorithms (A3C, DDQN, DDPG, Dueling DDQN)
528 stars 149 forks source link

Axes don't match array #31

Closed DalalAbadi closed 3 years ago

DalalAbadi commented 3 years ago

Thank you so much for the great effort of creating this... I had this issue when I try to load the model using load_and_run.py script

The command python3 load_and_run.py --type A3C --actor_path 'A3C/models/A3C_ENV_CartPole-v1_NB_EP_10000_BS_64_LR_0.0001_actor.h5' --critic_path 'A3C/models/A3C_ENV_CartPole-v1_NB_EP_10000_BS_64_LR_0.0001_critic.h5'

Error : File "/Deep-RL-Keras-master/venv/lib/python3.6/site-packages/keras/engine/topology.py", line 3152, in preprocess_weights_for_loading weights[0] = np.transpose(weights[0], (3, 2, 0, 1)) File "<__array_function__ internals>", line 6, in transpose File "/Deep-RL-Keras-master/venv/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 653, in transpose return _wrapfunc(a, 'transpose', axes) File "/Deep-RL-Keras-master/venv/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc return bound(*args, **kwds) ValueError: axes don't match array