You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When preprocessing is included in the model, preprocessing-related variables, which should be buffers for the model, are not passed as they should. This raises problems when we try to do model.to(dtype/device).
We could change the way preprocessing is passed to the model. Instead of as an attribute, we can use a property and define a set_preprocessing method which automatically loads the buffers of the preprocessing module into the model one (and remove them if preprocessing is set to None again).
We should also modify the Transform classes in the transform branch accordingly to have the needed variables saved as buffers, of course.
When preprocessing is included in the model, preprocessing-related variables, which should be buffers for the model, are not passed as they should. This raises problems when we try to do
model.to(dtype/device)
.We could change the way preprocessing is passed to the model. Instead of as an attribute, we can use a property and define a
set_preprocessing
method which automatically loads the buffers of the preprocessing module into the model one (and remove them if preprocessing is set to None again).We should also modify the
Transform
classes in thetransform
branch accordingly to have the needed variables saved as buffers, of course.What do you think @andrrizzi?
Maybe we can also use the new approach to set the
in/out_features
and theexample_input
in the CV model in case of pre/postprocessing, maybeThe text was updated successfully, but these errors were encountered: