Hi there,
I am currently using IMP to generate several models in which I apply a set of 62 restraints, plus ExcludeVolume (I work with XYZR sphere decorators). When I try to run the script 1000 times in order to generate 1000 different models, it work. However, when I try to run it 50.000 times, it came up with an error:
*The script does the following:*
o = IMP.core.ConjugateGradients(model_to_optimize) o.set_scoring_function(scoring_function) # this method return the scoring function that is being used o.optimize(num_iterations) # The maximum number of iteration of the optimizer to perform. # Returns the final score
*When I try to run it a lot of times, the following error come up:*
""" Traceback (most recent call last): File "/home/altair/bin/pycharm-community-2019.2.3/helpers/pydev/pydevd.py", line 1415, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/altair/bin/pycharm-community-2019.2.3/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/altair/PycharmProjects/IMP/SCRIPTS_ALTAIR/scripts/exocyst_architecture.py", line 18, in <module> * n=50000*, tags=False, log_file=False) File "/home/altair/PycharmProjects/IMP/SCRIPTS_ALTAIR/scripts/exocyst_main.py", line 655, in create_models * conjugate_gradient_optimization*(model, sf, num_iterations) # OPTIMIZATION STEP # File "/home/altair/PycharmProjects/IMP/SCRIPTS_ALTAIR/scripts/exocyst_main.py", line 223, in conjugate_gradient_optimization * o.optimize(num_iterations)* # The maximum number of iteration of the optimizer to perform. File "/home/altair/anaconda3/lib/python3.7/site-packages/IMP/__init__.py", line 5804, in optimize return _IMP_kernel.Optimizer_optimize(self, max_steps) _IMP_kernel.ModelException: Failure in ConjugateGradients
Process finished with exit code 1 """
What does it mean? Is it a problem on the max_steps of the Optimizer function? Why is this error comming up in the iteration 6000 ,e.g and not in the first one?
Thanks you!
Sincerely,
Altair
On 12/4/19 1:13 AM, Altair Hernández Chinchilla wrote: > I am currently using IMP to generate several models in which I apply a > set of 62 restraints, plus ExcludeVolume (I work with XYZR sphere > decorators). When I try to run the script 1000 times in order to > generate 1000 different models, it work. However, when I try to run it > 50.000 times, it came up with an error: ... > _IMP_kernel.ModelException: Failure in ConjugateGradients
CG will occasionally fail if your starting structure is particularly bad. This is perfectly normal.
Ben
Thank you Ben!
Is there an option to keep running the script even if this error comes up? I mean, to discard this particular bad structure, but keep trying with further structures until the last iteration (e.g 50.000)?
Thanks, Altair
On Wed, 4 Dec 2019 at 21:39, Ben Webb ben@salilab.org wrote:
> On 12/4/19 1:13 AM, Altair Hernández Chinchilla wrote: > > I am currently using IMP to generate several models in which I apply a > > set of 62 restraints, plus ExcludeVolume (I work with XYZR sphere > > decorators). When I try to run the script 1000 times in order to > > generate 1000 different models, it work. However, when I try to run it > > 50.000 times, it came up with an error: > ... > > _IMP_kernel.ModelException: Failure in ConjugateGradients > > CG will occasionally fail if your starting structure is particularly > bad. This is perfectly normal. > > Ben > -- > ben@salilab.org https://salilab.org/~ben/ > "It is a capital mistake to theorize before one has data." > - Sir Arthur Conan Doyle >
On 1/7/20 3:21 AM, Altair Hernández Chinchilla wrote: > Is there an option to keep running the script even if this error comes > up? I mean, to discard this particular bad structure, but keep trying > with further structures until the last iteration (e.g 50.000)?
Sure, just catch the exception and handle it however you like.
Ben