-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix: OSError when retrieving source code for lambda functions #606
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I fixed it by using
dill
to serialize and deserialize the functions, which appears to be more reliable.
It's not completely clear to me what this does, but if it works now, I'm happy to accept the change.
- I changed the
scipy.signal.bspline
import toscipy.interpolate.BSpline
to be up to date with a more recent version of scipy (minimum 1.13.1) as indicated in one of their latest releases (1.13.0). I did this since we prefer to not fix the versions, but just to indicate the minimum, and the previous requirement on scipy made the tests break because of this expired deprecation.
Given that we have much less time for this project now, maybe we can discuss fixing versions of many packages to avoid similar problems in the future? Also given that development of this package will slow down, at least for the moment, and current package versions work well with what we are currently doing, it may be less important to stay up to date with newest package versions.
This would be a separate PR though.
I hope it's clearer but in case we can have a chat about this :)
Very good point, I opened issue #607 :) |
While training a big network I got:
OSError: could not get source code
from the_save_model()
method of theTrainer
class, in particular when we dostr_expr = inspect.getsource(key["transform"])
. The error indicates that the inspect module is unable to retrieve the source code for the lambda function stored inkey["transform"]
.dill
to serialize and deserialize the functions, which appears to be more reliable.scipy.signal.bspline
import toscipy.interpolate.BSpline
to be up to date with a more recent version of scipy (minimum 1.13.1) as indicated in one of their latest releases (1.13.0). I did this since we prefer to not fix the versions, but just to indicate the minimum, and the previous requirement on scipy made the tests break because of this expired deprecation.