Hanjun-Dai / graph_comb_opt

Implementation of "Learning Combinatorial Optimization Algorithms over Graphs"
https://arxiv.org/abs/1704.01665
MIT License
491 stars 135 forks source link

trap divide error #24

Open camilocs89 opened 4 years ago

camilocs89 commented 4 years ago

Hi! I'm training another combinatorial problem and it works well. But, sometimes when I run ./run_nstep_dqn.sh this is stopped without error message.

In the system log appears this:

kernel: traps: python[7276] trap divide error ip:7f96bd2cea0b sp:7fffbb710190 error:0 in libcapmds.so[7f96bd202000+106000]

I think that occur because is trying divide a floating-point by zero, but what could be the cause of it? Thanks.

Hanjun-Dai commented 4 years ago

Hello,

Sorry I have no idea where it could be wrong. One place to look at is the per step reward, which will be divided by max norm. If it becomes zero then that might be problematic.

https://github.com/Hanjun-Dai/graph_comb_opt/blob/master/code/s2v_maxcut/maxcut_lib/src/lib/maxcut_env.cpp#L71

camilocs89 commented 4 years ago

Yes, that was the problem, thank you!