thanks bro,
I have not used move model to gpu than cpu between training and validation
I solved the problem first by adding del images; del labels
and I added in the validation phase
model.eval()
with torch.no_grad():
preds = model(images)
previously, it was
model.eval()
preds = model(images)