Skip to content

Commit fe6948c

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Fix f-string in color error message (#8639)
Reviewed By: vmoens Differential Revision: D62581689 fbshipit-source-id: 4caa36834e9928751e6a54e8cde394b972fe62f6
1 parent 0dcd180 commit fe6948c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,9 @@ def _parse_colors(
604604
f"Number of colors must be equal or larger than the number of objects, but got {len(colors)} < {num_objects}."
605605
)
606606
elif not isinstance(colors, (tuple, str)):
607-
raise ValueError("`colors` must be a tuple or a string, or a list thereof, but got {colors}.")
607+
raise ValueError(f"`colors` must be a tuple or a string, or a list thereof, but got {colors}.")
608608
elif isinstance(colors, tuple) and len(colors) != 3:
609-
raise ValueError("If passed as tuple, colors should be an RGB triplet, but got {colors}.")
609+
raise ValueError(f"If passed as tuple, colors should be an RGB triplet, but got {colors}.")
610610
else: # colors specifies a single color for all objects
611611
colors = [colors] * num_objects
612612

0 commit comments

Comments
 (0)