Does _setup_transform()
in Engine.fit
use the train transforms properly?
#2181
-
Discussed in #2100Originally posted by CarlosNacher May 31, 2024 I was looking the If you look into the
And if you go to datamodule (
it seems that even in Am I misunderstanding anything? Thank you so much in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Whats happening in During training and validation the images are not transformed by the model transforms, but by the transforms that are defined in the respective datamodules. |
Beta Was this translation helpful? Give feedback.
-
In addition to what @alexriedel1 described, i could add the following: if the user does not provide any custom transforms, the datamodule will use the transforms pre-defined by the model. These are the default ones that are reported in their respective papers. If the user wants to provide custom transforms, the datamodule takes those into account. At the end of the training they will be wrapped within the exported model. The idea behind is that a user should be able to pass a raw image to the inference model without requiring any additional pre-processing stages. All of this will be handled by the inference model. |
Beta Was this translation helpful? Give feedback.
-
I'm moving this to Q&A, from which we could continue to discuss. |
Beta Was this translation helpful? Give feedback.
-
Ohh, now I see it. I have dived deep into the code and I have understood, let me sum up my notes (in case someone might find it helpful):
Thank you so much for you helpful response! Cheers, |
Beta Was this translation helpful? Give feedback.
Whats happening in
_setup_transform
is setting the evaluation transform as the models default image transformation method. This is intended because during inference you want to use the eval transform only. The eval transform is stored to the model and saved in the model export file.During training and validation the images are not transformed by the model transforms, but by the transforms that are defined in the respective datamodules.