cvignac / DiGress

code for the paper "DiGress: Discrete Denoising diffusion for graph generation"
MIT License
369 stars 76 forks source link

RuntimeError: probability tensor contains either `inf`, `nan` or element < 0 #13

Closed mufeili closed 1 year ago

mufeili commented 1 year ago

Thank you for sharing the code. When I set dataset to comm20 or sbm in configs/config.yaml and invoke python main.py, I encountered the issue described in the title. Is this expected? Thanks.

cvignac commented 1 year ago

Hello, can you please run the following command and report the error message that you obtain? python3 main.py +experiment=debug dataset=comm20

Thank you

mufeili commented 1 year ago

With the command you suggested, the script finished successfully as follows.

1/1 complete
Visualizing molecules...
Done.
Computing sampling metrics...
Computing sampling metrics between 4 generated graphs and 20 test graphs -- emd computation: True
Building networkx graphs...
Saving all adjacency matrices
Computing degree stats..
Computing clustering stats...
Computing orbit stats...
Computing all fractions...
Sampling statistics {'clustering': 0.8605444028220715, 'orbit': 0.447127800139663, 'sampling/frac_unique': 1.0, 'sampling/frac_unique_non_iso': 1.0, 'sampling/frac_unic_non_iso_valid': 0.25, 'sampling/frac_non_iso': 1.0}
Done. Sampling took 4.70 seconds

Epoch 0 finished: X: 0.00 -- E: 0.41 y: -1.00 -- 4.8s
`Trainer.fit` stopped: `max_steps=1` reached.

I also tried python3 main.py dataset=comm20, which also worked. I guess it was simply not supported to directly modify the configuration file and I'll close the issue for now. Thanks.

cvignac commented 1 year ago

Hello, thanks to the help of Simone Antonelli, I found the bug that created this error. It was a problem in the computation of the marginals for the abstract dataset. This problem should now be fixed. Clement

mufeili commented 1 year ago

Thank you for the update!