Behavior of the trainer.fit function #4821
Labels
bug
Something isn't working
question
Further information is requested
waiting on author
Waiting on user action, correction, or update
won't fix
This will not be worked on
I am using the Lightning environment for training my NN model, and I am getting issues with the outputs. I decided to check the train dataset to ensure that it is not corrupted during preparing the data. However, according to where I print the inputs, I get different results. If I print the data directly after the pytorch Dataloader, I get what I expect.
Code
With this code, I get the 10 first train dataset, as they were provided in the files.
But if I print the data when it is fed in my model, I get something different:
Code
In this case, the first iteration is ok. The first batch of the training dataset is displayed properly, but the next ones are modified. It is not the values from the bag I am using. My guess is, that somewhere between the trainer.fit call and the model forward() method, the data are modified. I checked the trainer.fit() function from lightning, but couldn t find where it would be the case.
If I describe the data variables, train_dataloader is a list labels tensors and sample tensors. x is directly a tensor of sample tensor. So the starting point of the lightning code analysis would be where the sample batches are extracted, in order to be fed into the model:
When I do a print here, I get also something correct. So the x extracted here from batch is OK. The question would be, what happened to it at the line "y_hat = self.model(x)"
I could provide more insights on my code if needed, but I don t want to overload my question with too many details.
What's your environment?
The text was updated successfully, but these errors were encountered: