patchcore torch.pairwise_distance OOM on larger datasets
I get CUDA memory blowing when doing larger datasets
return torch.pairwise_distance(x1, x2, p, eps, keepdim)
RuntimeError: CUDA out of memory. Tried to allocate 724.00 MiB (GPU 0; 11.00 GiB total capacity; 7.62 GiB already allocated; 190.31 MiB free; 8.77 GiB reserved in total by PyTorch)
Is there anything that could be done here? like moving this computation to CPU?
@opassos Have you faced this patchcore issue https://github.com/openvinotoolkit/anomalib/issues/111?
Hi @opassos, yeah, as you said, we could make device type optional in the components. Currently almost all of them (ie., model, anomaly-map generators, metric computation) are on GPU, which may not be always efficient.
I guess i have the same problem. I opened up this discussion https://github.com/openvinotoolkit/anomalib/discussions/115 as i was not aware of this issue
Closing as this has been addressed in #1267