deel-ai / oodeel

Simple, compact, and hackable post-hoc deep OOD detection for already trained tensorflow or pytorch image classifiers.
https://deel-ai.github.io/oodeel/
MIT License
52 stars 2 forks source link

`is_from` failing on pytorch model #18

Closed Matt3164 closed 1 year ago

Matt3164 commented 1 year ago

is_from method is only looling at the first element of the dependency model.

model = torch.hub.load("chenyaofo/pytorch-cifar-models", "cifar10_resnet20", pretrained=True)
is_from(model, "torch")
# returns False instead of True
# > class_parents = ['pytorch_cifar_models', 'torch', 'object']

It should look at all elements from class_parents and check if torch is in it. Maybe a unit test on models defined in the test of the TorchFeatureExtractor could be useful and reproduce the bug above.

paulnovello commented 1 year ago

I patched the function in the very last PR.