MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://astroautomata.com/PySR
Apache License 2.0
2.33k stars 211 forks source link

[BUG]: got error:Process finished with exit code -1073741819 (0xC0000005) #332

Closed leochen1234321 closed 1 year ago

leochen1234321 commented 1 year ago

What happened?

Hi, I have successfully installed pysr.But when i run the demo in README, i got an error:

Version

0.12.3

Operating System

Windows

Package Manager

Conda

Interface

Other (specify below)

Relevant log output

process finished with exit code -1073741819 (0xC0000005)

Extra Info

I run the script on PyCharm. The script is as below: import numpy as np

X = 2 np.random.randn(100, 5) y = 2.5382 np.cos(X[:, 3]) + X[:, 0] ** 2 - 0.5

from pysr import PySRRegressor

model = PySRRegressor( niterations=40, # < Increase me for better results binary_operators=["+", "*"], unary_operators=[ "cos", "exp", "sin", "inv(x) = 1/x",

^ Custom operator (julia syntax)

],
extra_sympy_mappings={"inv": lambda x: 1 / x},
# ^ Define operator for SymPy as well
loss="loss(prediction, target) = (prediction - target)^2",
# ^ Custom loss function (julia syntax)

)

model.fit(X, y) print(model)

MilesCranmer commented 1 year ago

Did it finish running and then error? Or was the error before it even started? Are you able to repeat this each time you run?

leochen1234321 commented 1 year ago

Did it finish running and then error? Or was the error before it even started? Are you able to repeat this each time you run?

It didn't finished and an error occurs. The script has started, it prints "Started!". I can repeat the error every time i run the script.

MilesCranmer commented 1 year ago

Thanks. Can you tell me the output of the following command (ran in terminal)?

julia -e 'import InteractiveUtils as IU; IU.versioninfo()'

this will give me info about your Julia version and install.

leochen1234321 commented 1 year ago

Thanks. Can you tell me the output of the following command (ran in terminal)?

julia -e 'import InteractiveUtils as IU; IU.versioninfo()'

this will give me info about your Julia version and install. I got this: Julia Version 1.7.3 Commit 742b9abb4d (2022-05-06 12:58 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: Intel(R) Xeon(R) W-1250 CPU @ 3.30GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-12.0.1 (ORCJIT, skylake)

MilesCranmer commented 1 year ago

Thanks. Your Julia version is 1.7.3 which I have noted to be a bit unstable on Windows with PyJulia. Could you perhaps upgrade to Julia 1.9.0 (the latest version)? I have observed much greater stability in the unit tests on Windows with recent versions.

If your package manager version's latest is 1.7.3, then I recommend using juliaup to install Julia: https://github.com/JuliaLang/juliaup

leochen1234321 commented 1 year ago

Thanks. Your Julia version is 1.7.3 which I have noted to be a bit unstable on Windows with PyJulia. Could you perhaps upgrade to Julia 1.9.0 (the latest version)? I have observed much greater stability in the unit tests on Windows with recent versions.

If your package manager version's latest is 1.7.3, then I recommend using juliaup to install Julia: https://github.com/JuliaLang/juliaup

Thanks. I use the latest version Julia 1.9.0. It works for me now.

MilesCranmer commented 1 year ago

Awesome to hear!