Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Loading model from 0.19 on 1.3 #802

Open
GZW1234 opened this issue Jan 8, 2025 · 2 comments
Open

[BUG]: Loading model from 0.19 on 1.3 #802

GZW1234 opened this issue Jan 8, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@GZW1234
Copy link

GZW1234 commented Jan 8, 2025

What happened?

A bug happened!

Version

1.3.1

Operating System

Windows

Package Manager

pip

Interface

Jupyter Notebook

Relevant log output

~\AppData\Local\Temp\ipykernel_12944\3777221198.py in <cell line: 2>()
      1 Eq_No_tps = 21
----> 2 model_tps.sympy(Eq_No_tps)

D:\Python310Install\lib\site-packages\pysr\sr.py in sympy(self, index)
   2424             SymPy representation of the best equation.
   2425         """
-> 2426         if not self.expression_spec_.supports_sympy:
   2427             raise ValueError(
   2428                 f"`expression_spec={self.expression_spec_}` does not support sympy export."

D:\Python310Install\lib\site-packages\pysr\sr.py in expression_spec_(self)
   1312     @property
   1313     def expression_spec_(self):
-> 1314         return self.expression_spec or ExpressionSpec()
   1315 
   1316     def get_best(

AttributeError: 'PySRRegressor' object has no attribute 'expression_spec'

Extra Info

No response

@GZW1234 GZW1234 added the bug Something isn't working label Jan 8, 2025
@MilesCranmer
Copy link
Owner

Oh I guess this is from loading a model on a newer version? You can just do

model.expression_spec = None

After loading

@MilesCranmer
Copy link
Owner

Though I’m not sure it will work FYI. The underlying Julia backend changed so much between versions 0.19 and 1.0 that it might be completely incompatible with the old pickle file.

@MilesCranmer MilesCranmer changed the title [BUG]: Based on the model established in version 0.19. 4, after updating to version 1.3. 1, the "model_tps. sympy ()" code runs with "if not self.expression_spec_.supports_sympy:" and "return self.expression_spec or ExpressionSpec ()" error "AttributeError: 'PySRRegressor' object has no attribute 'expression_spec'" respectively. [BUG]: Loading model from 0.19 on 1.3 Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants