Last active
March 27, 2022 15:11
-
-
Save umitkacar/bb81aad6b1ae0509304f54d9065ea8f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dataset, val_set = torch.utils.data.random_split(dataset,[int(len(dataset) * 0.85), | |
len(dataset) - int(len(dataset) * 0.85)]) | |
config.manual_seed = 33 | |
print("Random Seed: ", config.manual_seed) | |
random.seed(config.manual_seed) | |
torch.manual_seed(config.manual_seed) | |
if torch.cuda.is_available(): | |
torch.cuda.manual_seed_all(config.manual_seed) | |
torch.backends.cudnn.deterministic = True | |
torch.backends.cudnn.benchmark = False | |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment