delete label.cache in folder valid and train using pathlib import path in python
main.py
from pathlib import Path
# Define the path to the parent folderparent_folder = Path('path/to/parent/folder')
# Define the paths to the cache files in the valid and train foldersvalid_cache = parent_folder / 'valid' / 'label.cache'train_cache = parent_folder / 'train' / 'label.cache'# Delete the cache files if they existif valid_cache.exists():
valid_cache.unlink()
print(f'{valid_cache} deleted successfully')
if train_cache.exists():
train_cache.unlink()
print(f'{train_cache} deleted successfully')