Thinklab-SJTU/EDA-AI

NesterovAcceleratedGradientOptimizer param_groups[0]['obj_k_1'] is empty list

zhouyusd opened this issue · 3 comments

I ran the command

python DeepPlace/main.py --task "fullplace" --algo ppo --use-gae --lr 2.5e-4 --clip-param 0.1 --value-loss-coef 0.5 --num-processes 1 --num-steps 2840 --num-mini-batch 4 --log-interval 1 --use-linear-lr-decay --entropy-coef 0.01

I got the error:

[{'params': [Parameter containing:
tensor([11612.3311, 11638.4473, 11630.4658,  ..., 17524.0566,  2358.3323,
         7378.4912], device='cuda:0', requires_grad=True)], 'lr': tensor(3072.4233, device='cuda:0'), 'u_k': [], 'v_k': [], 'g_k': [], 'obj_k': [], 'a_k': [], 'alpha_k': [], 'v_k_1': [], 'g_k_1': [], 'obj_k_1': [], 'v_kp1': [None], 'obj_eval_count': 0}]
Traceback (most recent call last):
  File "main.py", line 210, in <module>
    main()
  File "main.py", line 133, in main
    obs, done, reward = envs.step(action)
  File "/root/DeepPlace/fullplace_env.py", line 268, in step
    reward = new_cal_re(self.results, self.params)
  File "/root/DeepPlace/fullplace_env.py", line 173, in new_cal_re
    r = place(params)
  File "/root/DeepPlace/fullplace_env.py", line 55, in place
    metrics = placer(params, placedb)
  File "/root/DeepPlace/NonLinearPlace.py", line 273, in __call__
    one_descent_step(Lgamma_step, Llambda_density_weight_step, Lsub_step, iteration, Lsub_metrics)
  File "/root/DeepPlace/NonLinearPlace.py", line 243, in one_descent_step
    cur_metric.objective = optimizer.param_groups[0]['obj_k_1'][0].data.clone()
IndexError: list index out of range

How should I fix it?

Sorry that I have never met this problem, but it seems there is something wrong with the DREAMPlace part. Maybe you can refer to https://github.com/limbo018/DREAMPlace/issues for similar issues.

Hope you fix this problem now. I have an idea about how to fix it: limbo018/DREAMPlace#164, and I want to know if this method is correct for this issue?

I have already solved this problem, thanks very much.