SupContrast
SupContrast copied to clipboard
file “main_linear.py”, line103, set_model(opt) ,if torch.cuda.is_available() is false, why model will not load_state_dict(state_dict)
` if torch.cuda.is_available(): ......... model = model.cuda() classifier = classifier.cuda() criterion = criterion.cuda() cudnn.benchmark = True
model.load_state_dict(state_dict)
`
Thanks for pointing it out. you are right, that's bad engineering Habit. I was assuming people using this code will had GPU.
Added the else error message.