Closed victor-mageto closed 4 years ago
Thanks~
I am facing this error while compiling the visualize.py file, what could be the problem
I am facing this error too.Have u worked out this problem?
I am facing this error while compiling the visualize.py file, what could be the problem
you should consider installing pytorch with CUDA
@lander1003 I have installed PyTorch and PyTorchvision for CPU, I don't have CUDA supported GPU in my system.
@lander1003 I have installed PyTorch and PyTorchvision for CPU, I don't have CUDA supported GPU in my system.
Please refer to https://github.com/WuJie1010/Facial-Expression-Recognition.Pytorch/issues/9
net = VGG('VGG19') checkpoint = torch.load(os.path.join('FER2013_VGG19', 'PrivateTest_model.t7')) device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') net.load_state_dict(checkpoint['net']) net.to(device) net.eval()
ncrops, c, h, w = np.shape(inputs)
inputs = inputs.view(-1, c, h, w) inputs = inputs.to(device) inputs = Variable(inputs) outputs = net(inputs)
These changes worked out for me, you can try them on your machine.
I am still seeing this error and the above code doesnt seem to fix it. anyone else facing the same too?
raise RuntimeError
Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location