Skip to content
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

Preprocessing variables not defined as buffers of model #68

Open
EnricoTrizio opened this issue May 22, 2023 · 0 comments
Open

Preprocessing variables not defined as buffers of model #68

EnricoTrizio opened this issue May 22, 2023 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@EnricoTrizio
Copy link
Collaborator

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.

What do you think @andrrizzi?

Maybe we can also use the new approach to set the in/out_features and the example_input in the CV model in case of pre/postprocessing, maybe

@EnricoTrizio EnricoTrizio added bug Something isn't working enhancement New feature or request labels May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant