GraphINVENT icon indicating copy to clipboard operation
GraphINVENT copied to clipboard

Recurring Error in copy_terminated_graphs

Open oriondollar opened this issue 2 years ago • 0 comments

Hi there,

I've been working with your repo to train a graph network on the QM9 dataset. However, every time I try to generate molecules I get the same index error (see below). I tried adding a 3x buffer instead of 2x to the self.likelihoods array (qm9 has 9 max nodes) which seemed to make this error occur less often, but it's still occurring often enough that it's difficult to sample even 10K structures before it throws an exception. Is there something I can change to make sampling more robust or do you have any other suggestions?

Thanks!

Traceback (most recent call last):
  File "evaluate_metrics.py", line 49, in <module>
    assess_distribution_learning(workflow, train_file, test_file, test_scaffold_file,
  File "/gscratch/pfaendtner/orion/guacamol/guacamol/assess_distribution_learning.py", line 36, in assess_distribution_learning
    _assess_distribution_learning(model=model,
  File "/gscratch/pfaendtner/orion/guacamol/guacamol/assess_distribution_learning.py", line 88, in _assess_distribution_learning
    result, unique = uniqueness.assess_model(model, valid)
  File "/gscratch/pfaendtner/orion/guacamol/guacamol/distribution_learning_benchmark.py", line 117, in assess_model
    molecules = sample_valid_molecules(model=model, number_molecules=self.number_samples,
  File "/gscratch/pfaendtner/orion/guacamol/guacamol/utils/sampling_helpers.py", line 29, in sample_valid_molecules
    samples = model.generate(remaining_to_sample)
  File "/gscratch/pfaendtner/orion/codes/vaes/GraphINVENT/graphinvent/Workflow.py", line 679, in generate
    termination) = generator.sample()
  File "/gscratch/pfaendtner/orion/codes/vaes/GraphINVENT/graphinvent/GraphGenerator.py", line 66, in sample
    n_generated_graphs = self.build_graphs()
  File "/gscratch/pfaendtner/orion/codes/vaes/GraphINVENT/graphinvent/GraphGenerator.py", line 138, in build_graphs
    n_generated_so_far = self.copy_terminated_graphs(
  File "/gscratch/pfaendtner/orion/codes/vaes/GraphINVENT/graphinvent/GraphGenerator.py", line 375, in copy_terminated_graphs
    self.likelihoods[terminate_idc, generation_round] = likelihoods_sampled[terminate_idc]
IndexError: index 27 is out of bounds for dimension 1 with size 27

oriondollar avatar Apr 29 '22 19:04 oriondollar