hi,there is an RuntimeError:…/casadi/core/sx_function.cpp:149: Code generation of ‘casadi_model_cost_y_e_fun’ is not possible since variables [a_h] are free.
Where the [a_h] is my only control input,but I do know what means “since variables [a_h] are free”.
Anyone knows what is wrong?
Here is all Traceback:
Traceback (most recent call last):
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/tune/trial_runner.py", line 426, in _process_trial
result = self.trial_executor.fetch_result(trial)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/tune/ray_trial_executor.py", line 378, in fetch_result
result = ray.get(trial_future[0], DEFAULT_GET_TIMEOUT)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/worker.py", line 1457, in get
raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(RuntimeError): ray::PPO.train() (pid=9687, ip=192.168.6.112)
File "python/ray/_raylet.pyx", line 636, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 619, in ray._raylet.execute_task.function_executor
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/agents/trainer.py", line 444, in train
raise e
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/agents/trainer.py", line 433, in train
result = Trainable.train(self)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/tune/trainable.py", line 176, in train
result = self._train()
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/agents/trainer_template.py", line 129, in _train
fetches = self.optimizer.step()
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/optimizers/multi_gpu_optimizer.py", line 140, in step
self.num_envs_per_worker, self.train_batch_size)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/optimizers/rollout.py", line 29, in collect_samples
next_sample = ray_get_and_free(fut_sample)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/utils/memory.py", line 33, in ray_get_and_free
result = ray.get(object_ids)
ray.exceptions.RayTaskError(RuntimeError): ray::RolloutWorker.sample() (pid=9764, ip=192.168.6.112)
File "python/ray/_raylet.pyx", line 636, in ray._raylet.execute_task
File "python/ray/_raylet.pyx", line 619, in ray._raylet.execute_task.function_executor
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/evaluation/rollout_worker.py", line 471, in sample
batches = [self.input_reader.next()]
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/evaluation/sampler.py", line 56, in next
batches = [self.get_data()]
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/evaluation/sampler.py", line 99, in get_data
item = next(self.rollout_provider)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/evaluation/sampler.py", line 340, in _env_runner
base_env.send_actions(actions_to_send)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/env/base_env.py", line 332, in send_actions
self.vector_env.vector_step(action_vector)
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/ray/rllib/env/vector_env.py", line 110, in vector_step
obs, r, done, info = self.envs[i].step(actions[i])
File "/home/vcdc/flow/flow/envs/base.py", line 364, in step
self.apply_rl_actions(rl_actions)
File "/home/vcdc/flow/flow/envs/base.py", line 616, in apply_rl_actions
self._apply_rl_actions(rl_clipped)
File "/home/vcdc/flow/flow/envs/merge.py", line 326, in _apply_rl_actions
ocp_solver = AcadosOcpSolver(ocp, json_file='acados_ocp.json')
File "/home/vcdc/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 796, in __init__
ocp_generate_external_functions(acados_ocp, model)
File "/home/vcdc/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 611, in ocp_generate_external_functions
generate_c_code_nls_cost(model, model.name, 'terminal', opts)
File "/home/vcdc/acados/interfaces/acados_template/acados_template/generate_c_code_nls_cost.py", line 97, in generate_c_code_nls_cost
y_fun.generate( fun_name, casadi_opts )
File "/home/vcdc/anaconda3/envs/flow/lib/python3.7/site-packages/casadi/casadi.py", line 12702, in generate
return _casadi.Function_generate(self, *args)
RuntimeError: .../casadi/core/sx_function.cpp:149: Code generation of 'casadi_model_cost_y_e_fun' is not possible since variables [a_h] are free.
2021-08-27 09:37:07,487 INFO trial_runner.py:530 -- Trial PPO_MergePOEnv-v0_45273510: Attempting to recover trial state from last checkpoint.
2021-08-27 09:37:07,492 INFO ray_trial_executor.py:121 -- Trial PPO_MergePOEnv-v0_45273510: Setting up new remote runner.
(pid=9764) Exception ignored in: <function AcadosOcpSolver.__del__ at 0x7f515f783a60>
(pid=9764) Traceback (most recent call last):
(pid=9764) File "/home/vcdc/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 1469, in __del__
(pid=9764) model = self.acados_ocp.model
(pid=9764) AttributeError: 'AcadosOcpSolver' object has no attribute 'acados_ocp'