data_efficient_grammar icon indicating copy to clipboard operation
data_efficient_grammar copied to clipboard

ZeroDivisionError: division by zero

Open naoren opened this issue 2 years ago • 0 comments

Hello, thank you for your wonderful project. There were some problems when I tried to apply code on a polymer dataset using --motif command. Is this the problem of my SMILES strings, or other possible problems, and how should I solve it?

Graph contraction status: True Start grammar evaluation... Generating sample 0/100 Traceback (most recent call last): File "main.py", line 211, in learn(mol_sml, args) File "main.py", line 130, in learn eval_metric = evaluate(l_grammar, args, metrics=['diversity', 'syn']) File "main.py", line 33, in evaluate mol, iter_num = random_produce(grammar) File "D:\D_E_G\grammar_generation.py", line 162, in random_produce _, idx = sample(starting_rules) File "D:\D_E_G\grammar_generation.py", line 139, in sample prob = [1/len(l)] * len(l) ZeroDivisionError: division by zero

naoren avatar Jul 04 '22 08:07 naoren