Open YanisLalou opened 4 months ago
We had a brief discussion of this problem in the Slack chat. It also makes behavior of selectors somewhat unpredictable, as they perform clone
of the base estimator before fitting. The reasons for copy to fail is that torch blocks copying of the tensor that is attached to the gradients graph. It should be possible to define own cloning hook by taking parameters of the module and calling constructor (not sure if it works for deepcopy as well, but I would rather say it's better to switch splitter to sklearn clone).
Linked to #163 and fixed by #169
After fitting a
DomainAwareNet
, it's not possible to deep copy it. Strangely it works before the fitting. Error raised:AttributeError: Can't pickle local object '_get_intermediate_layers.<locals>.hook'
It's necessary to be able to deep copy it to use the
CircularValidation
scorer.To reproduce: