scumzilla:

torch.manual_seed(1)

use_cuda = True
## best for all = batch size = 48, lr = 0.005, num epoch = 45
batch_size = 48
lr = 0.005
num_epochs = 45
train_loader, val_loader = get_data_loader(batch_size)
small_net = SmallNet2()
encoder = Encoder()
path = "C:\\Users\Stephanie\PycharmProjects\capstone\Autoencoder_model2"
encoder.load_state_dict(torch.load(path))
encoder.eval()

if use_cuda and torch.cuda.is_available():
  print("CUDA is available")
  small_net = small_net.cuda()
  encoder = encoder.cuda()
else:
    print("CUDA is not available")



Note that you should keep all your code other than functions inside if __name__=="__main__" block. I think that’s why you see multiple print statements.