-
Notifications
You must be signed in to change notification settings - Fork 92
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]: Using SymPy in custom loss function results in julia crash #344
Comments
This is a known incompatibility between the older PyCall.jl (which SymPy.jl still uses) and PythonCall.jl (which PySR has upgraded to). The fix is to call sympy directly using PythonCall. See https://juliapy.github.io/PythonCall.jl/stable/pythoncall/ for the docs. |
I would also recommend using SymbolicUtils.jl instead of SymPy, which SymbolicRegression.jl has a built-in converter to. It will be MUCH faster. SymPy will be extremely slow. |
Thank you for your quick reply. |
Symbolics.jl is a front end for SymbolicUtils.jl. They’re the same though |
oh okay, I didnt notice. |
It’s because I haven’t updated the version compatibility for SymbolicUtils yet. This PR needs to merge first: #326 |
What happened?
I am working on an invertible symbolic regression task using
SymPy
in Julia. The goal is to obtain a symbolic expression that can be accurately expressed in each of the used variables. I was usingSymPy
to evaluate the performance of the found expression, even when solving for different variables.My loss function isolated works as intended when using it directly with a tree, dataset, and options. However, when I attempt to use this same loss function in the
SRRegressor
, the Julia process crashes unexpectedly, and the console quits with an error.Version
0.0.0
Operating System
Windows
Interface
Julia REPL
Relevant log output
Extra Info
MWE which should reproduce the error:
The text was updated successfully, but these errors were encountered: