I was skimming through the benchmark notebook you introduced in your blog.
def add_paths(df, feature_dir, label_dir=None, bands=BANDS):
"""
Given dataframe with a column for chip_id, returns a dataframe with a column
added indicating the path to each band's TIF image as "{band}_path", eg "B02_path".
A column is also added to the dataframe with paths to the label TIF, if the
path to the labels directory is provided.
"""
for band in bands:
df[f"{band}_path"] = feature_dir / df["chip_id"] / f"{band}.tif"
assert df[f"{band}_path"].path.exists().all()
if label_dir is not None:
df["label_path"] = label_dir / (df["chip_id"] + ".tif")
assert df["label_path"].path.exists().all()
return df
train_meta = add_paths(train_meta, TRAIN_FEATURES, TRAIN_LABELS)
train_meta.head()
The above code cell is throwing an error: TypeError: expected str, bytes or os.PathLike object, not Series
@Tashin That error is not raised when we run the benchmark - we are able to run it from end to end with no issues.
If you provide more detail on your error (eg. the stack trace, what you are using as arguments) others may be able to help debug. One thought is to check the competition runtime environment specifications and see if you have any mismatching package versions.
You could also run the notebook the Planetary Computer Hub instead - it is available in their tutorials here.