5,321
edits
Line 111: | Line 111: | ||
To compute the accuracy, you can use [https://pytorch.org/docs/stable/generated/torch.argmax.html <code>torch.argmax</code>] to get the top prediction or [https://pytorch.org/docs/stable/generated/torch.topk.html <code>torch.topk</code>] to get the top-k prediction. | To compute the accuracy, you can use [https://pytorch.org/docs/stable/generated/torch.argmax.html <code>torch.argmax</code>] to get the top prediction or [https://pytorch.org/docs/stable/generated/torch.topk.html <code>torch.topk</code>] to get the top-k prediction. | ||
==Debugging== | |||
{{see also | Debugging ML Models}} | |||
If you get a cuda kernel error, you can rerun with the environment variable <code>CUDA_LAUNCH_BLOCKING=1</code> to get the correct line. | |||
<pre> | |||
CUDA_LAUNCH_BLOCKING=1 python app.py | |||
</pre> | |||
==TensorBoard== | ==TensorBoard== |