Torch hub vision models vs Timm models
I'm trying to modify the following repo: https://github.com/hcw-00/PatchCore_anomaly_detection, by trying to use the timm pretrained models instead of torch hub vision models(as in the paper). When I try to do that, I always get NaN values when i calculate the distance function:
anomaly_map = score_patches[:, 0].reshape((28, 28))
N_b = score_patches[np.argmax(score_patches[:, 0])]
w = (1 - (np.max(np.exp(N_b)) / np.sum(np.exp(N_b))))
With the errors and warnings I was able to figure out that there were some overflows occurring which could be the reason. The same script when I run it with torch hub vision models (same architecture as timm models and similar number of params), it runs well.
what is the difference between the two models?
Any help, references to articles/papers?
from Recent Questions - Stack Overflow https://ift.tt/3DPwmoN
https://ift.tt/eA8V8J
Comments
Post a Comment