fix: OSError when retrieving source code for lambda functions#606
fix: OSError when retrieving source code for lambda functions#606
Conversation
There was a problem hiding this comment.
- I fixed it by using
dillto 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.bsplineimport toscipy.interpolate.BSplineto 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 codefrom the_save_model()method of theTrainerclass, 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"].dillto serialize and deserialize the functions, which appears to be more reliable.scipy.signal.bsplineimport toscipy.interpolate.BSplineto 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.