You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copying the code snippets into a file and executing doesn't work, as the testAccuracy function doesn't test for GPU. So if you are using a GPU and the train function loads the train dataset/model weights onto the GPU, you receive the following error:
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor
Copying the code snippets into a file and executing doesn't work, as the testAccuracy function doesn't test for GPU. So if you are using a GPU and the train function loads the train dataset/model weights onto the GPU, you receive the following error:
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor
Fixing this by adding the following:
images, labels = images.to(device), labels.to(device)
to the testAccuracy function after "images, labels = data"
In addition, the main method calls a testModelAccuracy function that doesn't exist. From the code sample referenced in GitHub (https://github.com/microsoft/Windows-Machine-Learning/blob/master/Samples/Tutorial%20Samples/PyTorch%20Image%20Classification/PyTorchTraining%20-%20Image%20Classification/PyTorchTraining.py), it appears a testClasses function is required.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: