Lighting Module Loaded From Checkpoint Generates Different Output Each Time #12397
-
I'm trying to gain some confidence in a model that seems to be training fine. As a simple sanity check I'm trying to make sure I can load then test a checkpoint with the same input, expecting to be able to produce the same output each and every time (I'm using the same input and checkpoint each time so I expect the output to be the same). Unfortunately, I'm observing different output each time I reload the checkpoint. Here is the essence of what I'm doing:
It is also probably worth noting that the model trained/loaded by my_module is a hugginface T5 transformer (T5ForConditionalGeneration ) Please help me figure out how to ensure output is consistent after loading a trained checkpoint. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Turns out that I was doing something a little different in the actual code than: When I do this exactly, things work as expected :) |
Beta Was this translation helpful? Give feedback.
Turns out that I was doing something a little different in the actual code than:
my_module = MyLightningModule.load_from_checkpoint(ckpt_path)
When I do this exactly, things work as expected :)