LearningToCompare_FSL
LearningToCompare_FSL copied to clipboard
RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.
(base) C:\Users\B4-410\lpthw\LearningToCompare_FSL-master\miniimagenet>python miniimagenet_train_one_shot.py -w 5 -s 1 -b 15
init data folders
init neural networks
Traceback (most recent call last):
File "miniimagenet_train_one_shot.py", line 269, in
i met the same problem.
you have to assign a certain gpu.
find the file miniimagenet_train_one_shot.py from : #feature_encoder.load_state_dict(torch.load(str("./models/miniimagenet_feature_encoder_" + str(CLASS_NUM) +"way_" + str(SAMPLE_NUM_PER_CLASS) +"shot.pkl"))) to : feature_encoder.load_state_dict(torch.load(str("./models/miniimagenet_feature_encoder_" + str(CLASS_NUM) +"way_" + str(SAMPLE_NUM_PER_CLASS) +"shot.pkl"), map_location='cuda:0'))
also the same as the relation_network part.
hope helpful to you