Hello! I trained a model and I want to test it on some given values. I load the values like this:
factors = torch.from_numpy(variables)
factors = factors.cuda()
factors = factors.float()

and then I put the model in the evaluation mode and run it:
model = SimpleNet(n_variables).cuda()
model.load_state_dict(torch.load("weights.h5"))
model.eval()
model(factors)

But I am getting a CUDA error: out of memory error. If I reduce the size of “factors” it works fine. I assume I am still keeping tracks of some gradients or something, even if the model is in evaluation mode (sorry I am pretty new to pytorch). Can someone help me with this please? Thank you!