Jammy2211 / autolens_workspace

The PyAutoLens workspace: contains example scripts, datasets and more
https://pyautolens.readthedocs.io/
24 stars 16 forks source link

NoOptionError : MultiNest #4

Closed skat00sh closed 4 years ago

skat00sh commented 4 years ago

While to try to run quickstart/qs_3_lens_modeling.ipynb I'm getting this error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/usr/lib/python3.6/configparser.py in get(self, section, option, raw, vars, fallback)
    788         try:
--> 789             value = d[option]
    790         except KeyError:

/usr/lib/python3.6/collections/__init__.py in __getitem__(self, key)
    882                 pass
--> 883         return self.__missing__(key)            # support subclasses that define __missing__
    884 

/usr/lib/python3.6/collections/__init__.py in __missing__(self, key)
    874     def __missing__(self, key):
--> 875         raise KeyError(key)
    876 

KeyError: 'terminate_at_acceptance_ratio'

During handling of the above exception, another exception occurred:

NoOptionError                             Traceback (most recent call last)
~/.local/lib/python3.6/site-packages/autoconf/named.py in get(self, section_name, attribute_name, attribute_type)
     48         try:
---> 49             string_value = self.parser.get(section_name, attribute_name)
     50         except configparser.NoSectionError:

/usr/lib/python3.6/configparser.py in get(self, section, option, raw, vars, fallback)
    791             if fallback is _UNSET:
--> 792                 raise NoOptionError(option, section)
    793             else:

NoOptionError: No option 'terminate_at_acceptance_ratio' in section: 'MultiNest'

During handling of the above exception, another exception occurred:

NoOptionError                             Traceback (most recent call last)
<ipython-input-9-1ab840078943> in <module>
      2     phase_name="phase_quick_start_example",
      3     galaxies=dict(lens_galaxy=lens_galaxy_model, source_galaxy=source_galaxy_model),
----> 4     optimizer_class=af.MultiNest,
      5 )

~/.local/lib/python3.6/site-packages/autofit/optimize/non_linear/paths.py in wrapper(self, *args, **kwargs)
     55                 remove_files=remove_files,
     56             ),
---> 57             **kwargs,
     58         )
     59 

~/.local/lib/python3.6/site-packages/autolens/pipeline/phase/imaging/phase.py in __init__(self, paths, galaxies, hyper_image_sky, hyper_background_noise, optimizer_class, cosmology, sub_size, signal_to_noise_limit, bin_up_factor, psf_shape_2d, positions_threshold, pixel_scale_interpolation_grid, inversion_uses_border, inversion_pixel_limit)
     65             galaxies=galaxies,
     66             optimizer_class=optimizer_class,
---> 67             cosmology=cosmology,
     68         )
     69 

~/.local/lib/python3.6/site-packages/autofit/optimize/non_linear/paths.py in wrapper(self, *args, **kwargs)
     39 
     40         if isinstance(first_arg, Paths):
---> 41             return func(self, paths=first_arg, **kwargs)
     42 
     43         if first_arg is None:

~/.local/lib/python3.6/site-packages/autolens/pipeline/phase/dataset/phase.py in __init__(self, paths, galaxies, optimizer_class, cosmology)
     41         """
     42 
---> 43         super(PhaseDataset, self).__init__(paths, optimizer_class=optimizer_class)
     44         self.galaxies = galaxies or []
     45         self.cosmology = cosmology

~/.local/lib/python3.6/site-packages/autofit/optimize/non_linear/paths.py in wrapper(self, *args, **kwargs)
     39 
     40         if isinstance(first_arg, Paths):
---> 41             return func(self, paths=first_arg, **kwargs)
     42 
     43         if first_arg is None:

~/.local/lib/python3.6/site-packages/autolens/pipeline/phase/abstract/phase.py in __init__(self, paths, optimizer_class)
     21         """
     22 
---> 23         super().__init__(paths=paths, optimizer_class=optimizer_class)
     24 
     25     @property

~/.local/lib/python3.6/site-packages/autofit/optimize/non_linear/paths.py in wrapper(self, *args, **kwargs)
     39 
     40         if isinstance(first_arg, Paths):
---> 41             return func(self, paths=first_arg, **kwargs)
     42 
     43         if first_arg is None:

~/.local/lib/python3.6/site-packages/autofit/tools/phase.py in __init__(self, paths, optimizer_class, model)
     33         self.paths = paths
     34 
---> 35         self.optimizer = optimizer_class(self.paths)
     36         self.model = model or ModelMapper()
     37 

~/.local/lib/python3.6/site-packages/autofit/optimize/non_linear/multi_nest.py in __init__(self, paths, sigma, run)
     49         self.init_MPI = self.config("init_MPI", bool)
     50         self.terminate_at_acceptance_ratio = conf.instance.non_linear.get(
---> 51             "MultiNest", "terminate_at_acceptance_ratio", bool
     52         )
     53         self.acceptance_ratio_threshold = conf.instance.non_linear.get(

~/.local/lib/python3.6/site-packages/autoconf/named.py in get(self, section_name, attribute_name, attribute_type)
     59                     attribute_name, section_name, self.path
     60                 ),
---> 61                 e.section,
     62             )
     63         if string_value == "None":

NoOptionError: No option 'could not find option terminate_at_acceptance_ratio in section MultiNest of config at path /home/devendra/projects/gsoc/autolens_workspace/config/non_linear.ini' in section: 'MultiNest'

Any idea what could be a default value of terminate_at_acceptance_ratio that could be set?

harshitjindal commented 4 years ago

This is a local issue on your machine, the notebook you linked works completely fine on my system.

Jammy2211 commented 4 years ago

MultiNest is now (finally) an optional install.