Shen-Lab / LDM-3DG

[ICLR 2024] "Latent 3D Graph Diffusion" by Yuning You, Ruida Zhou, Jiwoong Park, Haotian Xu, Chao Tian, Zhangyang Wang, Yang Shen
GNU General Public License v3.0
26 stars 6 forks source link

Error in evaluation step for Conditional Generation on Geometric Object #3

Open JiashuLiang opened 2 months ago

JiashuLiang commented 2 months ago

Hi Authors,

Congrats on the great work! I am trying to develop a flow-matching version of your work, but I encounter some challenges when reproducing your work on Conditional Generation on Geometric Objects.

When I ran Sampling and evaluating commands, I encountered the following error for all data_id I tried.

[2024-05-08 23:53:49,959::evaluate::INFO] Vina Score:  Mean: nan Median: nan
[2024-05-08 23:53:49,959::evaluate::INFO] Vina Min  :  Mean: nan Median: nan
Traceback (most recent call last):
  File "/global/cfs/cdirs/mp54/jsliang/MLFF/conda_envs/eval/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/global/cfs/cdirs/mp54/jsliang/MLFF/conda_envs/eval/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/global/cfs/cdirs/mp54/jsliang/LFM-3DG/AE_Geometry_and_Conditional_Latent_Diffusion/scripts/evaluate.py", line 154, in <module>
    print_ring_ratio([r['chem_results']['ring_size'] for r in results], logger)
  File "/global/cfs/cdirs/mp54/jsliang/LFM-3DG/AE_Geometry_and_Conditional_Latent_Diffusion/scripts/evaluate.py", line 34, in print_ring_ratio
    logger.info(f'ring size: {ring_size} ratio: {n_mol / len(all_ring_sizes):.3f}')
ZeroDivisionError: division by zero

What I changed are:

  1. the model used in sample_z because I do not have the folder ldm_2023_11_1618_01_30 `model.load_state_dict(torch.load('logs_diffusion/ldm_2023_11_1618_01_30/checkpoints/30000.pt')['model']) to model.load_state_dict(torch.load('../AE_geom_cond_weights_and_data/weight_diffusion.pt')['model'])`
  2. the version name from 'final-001' to 'final' in pl_pair_dataset.py to match the file name in https://github.com/guanjq/targetdiff#data def __init__(self, raw_path, transform=None, version='final'): Can you help check what's wrong?
yyou1996 commented 1 month ago

Hi @JiashuLiang,

This might result from multiple reasons. You probably need to remove the try/except https://github.com/Shen-Lab/LDM-3DG/blob/45c3a91a7895fefe38b8ec383f5fd64244c55e03/AE_Geometry_and_Conditional_Latent_Diffusion/scripts/evaluate.py#L100 to allow the error messages printed.