kvkarandashev / bmapqml

Machine learning for target property optimization.
MIT License
0 stars 0 forks source link

ValueError after most recent push #6

Closed janweinreich closed 2 years ago

janweinreich commented 2 years ago

When I rerun the minimization of atomization energies in QM9 (MC_all_moves_QM9.py) after the most recent update I get the following error (after a couple of successful iterations):

C=C1C(=C)C(C(O)OC(C)O)=C1O C=CC1=C2C=COC(COC1O)O2 C=C1C(=C)C(C(O)OC(C)O)=C1O 0 heavy atoms: [C:6,V:4,H:3, C:6,V:4,H:0, C:8,V:2,H:0, C:8,V:2,H:0, C:6,V:4,H:0, C:6,V:4,H:0, C:6,V:4,H:1, C:6,V:4,H:1, C:6,V:4,H:1, C:6,V:4,H:0, C:6,V:4,H:0, C:8,V:2,H:0, C:8,V:2,H:0] , bonds&orders: {(0, 1): 1, (1, 2): 2, (1, 3): 1, (3, 4): 1, (4, 5): 1, (5, 6): 2, (6, 7): 1, (7, 8): 2, (4, 9): 2, (8, 9): 1, (9, 10): 1, (10, 11): 2, (10, 12): 1, (5, 12): 1} 1 heavy atoms: [C:6,V:4,H:2, C:6,V:4,H:1, C:8,V:2,H:0, C:8,V:2,H:0, C:6,V:4,H:0, C:6,V:4,H:1, C:6,V:4,H:1, C:6,V:4,H:2, C:6,V:4,H:1, C:6,V:4,H:0, C:6,V:4,H:1, C:8,V:2,H:1, C:8,V:2,H:0] , bonds&orders: {(0, 1): 1, (1, 2): 1, (1, 3): 1, (3, 4): 1, (4, 5): 1, (5, 6): 2, (7, 8): 2, (4, 9): 2, (8, 9): 1, (9, 10): 1, (10, 11): 1, (10, 12): 1, (2, 6): 1, (0, 12): 1} 2 heavy atoms: [C:6,V:4,H:3, C:6,V:4,H:1, C:8,V:2,H:1, C:8,V:2,H:1, C:6,V:4,H:0, C:6,V:4,H:0, C:6,V:4,H:2, C:6,V:4,H:2, C:6,V:4,H:0, C:6,V:4,H:0, C:6,V:4,H:1, C:8,V:2,H:0, C:8,V:2,H:1] , bonds&orders: {(0, 1): 1, (1, 2): 1, (3, 4): 1, (4, 5): 1, (5, 6): 2, (7, 8): 2, (4, 9): 2, (8, 9): 1, (9, 10): 1, (10, 11): 1, (10, 12): 1, (5, 8): 1, (1, 11): 1} Traceback (most recent call last): File "MC_all_moves_QM9.py", line 79, in <module> rw.global_random_change(**global_change_params) File "/home/jan/projects/MOLOPT/molopt/bmapqml/chemxpl/random_walk.py", line 473, in global_random_change self.genetic_MC_step_all(**other_kwargs) File "/home/jan/projects/MOLOPT/molopt/bmapqml/chemxpl/random_walk.py", line 457, in genetic_MC_step_all self.genetic_MC_step(changed_replica_ids) File "/home/jan/projects/MOLOPT/molopt/bmapqml/chemxpl/random_walk.py", line 416, in genetic_MC_step new_cg_pair, prob_balance=randomized_cross_coupling(old_cg_pair, **self.used_randomized_change_params) File "/home/jan/projects/MOLOPT/molopt/bmapqml/chemxpl/modify.py", line 428, in randomized_cross_coupling trial_mols=all_potential_couplings(*all_pot_coup_args, **apc_kwargs) File "/home/jan/projects/MOLOPT/molopt/bmapqml/chemxpl/modify.py", line 402, in all_potential_couplings if mol_pair not in mol_pairs: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() so the error comes from random_walk.py or modify.py. looks a bit like one of the random walks went wrong. In particular if mol_pair not in mol_pairs:

janweinreich commented 2 years ago

so looks like a boolean value is evaluated over an array which causes an error

kvkarandashev commented 2 years ago

I have been able to run the script with no issues on the latest code version, but I'm not %100 sure whether it is due to something getting fixed or due to conda environment differences.

janweinreich commented 2 years ago

issue was magically resolved