Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
fix data outpye type
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarriba committed Apr 20, 2021
1 parent 32ac9b3 commit 0ef5d2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flash/vision/classification/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ def _load_data_dir(cls, data: Any, dataset: Optional[AutoDataset] = None) -> Lis
# labels might not contain the complete set of ids so that you can infer the total
# number of classes to train in your dataset.
dataset.num_classes = len(data)
out: List[str, int] = []
out: List[Tuple[str, int]] = []
for p, label in data:
if os.path.isdir(p):
# TODO: there is an issue here when a path is provided along with labels.
# os.listdir cannot assure the same file order as the passed labels list.
files_list: List[str] = os.listdir(p)
if len(files_list) > 1:
raise ValueError(
Expand Down

0 comments on commit 0ef5d2a

Please sign in to comment.