I encountered a ValueError while running the script train_rl_agents.py. The error occurs when trying to save an evaluation using np.savez in the save_evaluation method of trainer.py. The specific error message is as follows:
Traceback (most recent call last):
File "train_rl_agents.py", line 121, in <module>
run_trial(args.device,param)
File "train_rl_agents.py", line 100, in run_trial
trainer.learn(total_timesteps=params["total_timesteps"],
File "/home/hb/RLNav/Multi_Robot_Distributional_RL_Navigation/policy/trainer.py", line 179, in learn
self.save_evaluation(eval_log_path)
File "/home/hb/RLNav/Multi_Robot_Distributional_RL_Navigation/policy/trainer.py", line 371, in save_evaluation
np.savez(
File "<__array_function__ internals>", line 200, in savez
File "/home/hb/anaconda3/envs/1_body/lib/python3.8/site-packages/numpy/lib/npyio.py", line 615, in savez
_savez(file, args, kwds, False)
File "/home/hb/anaconda3/envs/1_body/lib/python3.8/site-packages/numpy/lib/npyio.py", line 716, in _savez
val = np.asanyarray(val)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 4 dimensions. The detected shape was (1, 1, 3, 1002) + inhomogeneous part.
The evaluation npz should be saved successfully without any errors.
A ValueError is raised, indicating an issue with the shape of the array being saved.
Any guidance on how to resolve this issue would be appreciated.