Skip to content

Commit d6f29b2

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] fix bug when using PIL backend in references/classification (#7665)
Summary: Co-authored-by: Max Chuprov <[email protected]> Reviewed By: vmoens Differential Revision: D46724127 fbshipit-source-id: 300232aadc8fe22ece46c229ec59ac0b95784756
1 parent 5c1f7a0 commit d6f29b2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

references/classification/presets.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ def __init__(
6969
backend="pil",
7070
):
7171
trans = []
72-
7372
backend = backend.lower()
7473
if backend == "tensor":
7574
trans.append(transforms.PILToTensor())
76-
else:
75+
elif backend != "pil":
7776
raise ValueError(f"backend can be 'tensor' or 'pil', but got {backend}")
7877

7978
trans += [

0 commit comments

Comments
 (0)