rhayes777 / PyAutoFit

PyAutoFit: Classy Probabilistic Programming
https://pyautofit.readthedocs.io/
MIT License
59 stars 11 forks source link

Issue loading samples summary model #1023

Open Jammy2211 opened 1 month ago

Jammy2211 commented 1 month ago

If I run the following test script:

https://github.com/Jammy2211/autolens_workspace_test/blob/main/scripts/database/scrape/general.py

I get the following error:

<autofit.non_linear.search.nest.dynesty.search.static.DynestyStatic object at 0x7fac97e2f520>
Traceback (most recent call last):
  File "/mnt/c/Users/Jammy/Code/PyAuto/autolens_workspace_test/scripts/database/scrape/general.py", line 158, in <module>
    instance = samples_summary.max_log_likelihood()
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/samples/interface.py", line 28, in wrapper
    vector = func(self, *args, **kwargs)
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/samples/interface.py", line 89, in max_log_likelihood
    self.paths if sample.is_path_kwargs else self.names
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/samples/interface.py", line 64, in paths
    self._paths = self.model.all_paths
AttributeError: 'NoneType' object has no attribute 'all_paths'

The SamplesSummary object is not loading the model from model.json correctly.

rhayes777 commented 1 month ago

I think the solution to this is to put the model back in the samples summary. We could consider having parallel samples summaries - one that the user sees and another that the system uses