My dataset script doesn't work. #4966
-
Hello, I am trying to get my first dataset working. Here is the link. But I can't get it to work. Any help would be awesome. My csv file head:
I think this part is the problem in the script: def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
data_dir = dl_manager.download_and_extract(_URLS)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"df_path": dl_manager.iter_files([data_dir["train_df"]]),
"split": "train",
"images_path": dl_manager.iter_archive([data_dir["train"]]),
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"df_path": dl_manager.iter_files([data_dir["test_df"]]),
"split": "test",
"images_path": dl_manager.iter_archive([data_dir["test"]]),
},
),
]
def _generate_examples(self, df_path, split, images_path):
dataframe = pd.read_csv(df_path, delimiter=",")
for id_, row in dataframe.iterrows():
yield id_, {
"image": os.path.join(images_path, row["image"]),
"bounding-box": row["BBox"],
"class": row["Class"],
} |
Beta Was this translation helpful? Give feedback.
Answered by
mariosasko
Sep 15, 2022
Replies: 1 comment
-
A duplicate of https://discuss.huggingface.co/t/my-dataset-loading-script-is-not-working/22971. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
osbm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A duplicate of https://discuss.huggingface.co/t/my-dataset-loading-script-is-not-working/22971.