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
Post a Comment