Fixing pickle errors to allow for multiprocessing #37
Fixing pickle errors to allow for multiprocessing #37dmklee wants to merge 1 commit intoQUVA-Lab:masterfrom
Conversation
Signed-off-by: David Klee <klee.d@northeastern.edu>
|
This definitely helped me when using escnn together with pytorch lightning which, when saving checkpoints, also relied on pickling. Using your fork I was finally able to reload my trained lightning models, which failed before. Thanks! |
|
Hey! Sorry for not having merged your PR yet, but I am not fully convinced that this is the best way to go at the moment. However, at the end, one needs to only pickle classes from I had already implemented a similar trick for groups, that's what the static Now, the question for me is how to integrate this with pickling. Please, feel free to comment on this or to give me some advice if you have some experience with this. Thanks, |
When training on multiple GPU's using ddp, there is an error with pickling escnn models. The solution was pointed out QUVA-Lab/e2cnn/pull/69 for the e2cnn library so I made similar modifications to escnn. This was discussed in issue #16.
I made a basic test file,
test_pickling.pyand I have fixed the problem for C(n) and D(n) on R2. I am happy to extend it to other groups if you want. The pickling error occurs because escnn uses local functions which cannot be pickled. The fix is to convert local functions to the__call__methods of a class.