model - How can I change this GPU code in CPU code? -


all.

this simple gpu code in pytorch.

how can change in cpu code?

filename=r’./test/bees/1.jpg’ img = skimage.io.imread(filename)  x = v(centre_crop(img).unsqueeze(0), volatile=true).cuda()  model = models.dict(’resnet18’) model = torch.nn.dataparallel(model).cuda()  model = torch.load(‘model5.pth’)  logit = model(x) print(logit) 

thanks in advance .


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -