Add file overwriting option in create_database
Closed
Add file overwriting option in create_database
I'm having trouble running the ketos tutorial 1 because every time I re run the tutorial the 2000 train files and 200 val files are re added to database.h5. I can't find a straight forward way to clear the database before I re run it so it would be great if create_database could have an option to overwrite the existing database files.
Hi @nicole,
If you want to replace the file, you could do something like this before calling the create_database function:
#Delete the database.h5 file if it already exists import os if os.path.exists("database.h5"): os.remove("database.h5")
I imagine you are running that tutorial multiple times because you are changing the data sources or the data processing steps. If you want to keep different versions, you can create different database_files (by giving different values to
output_file
) or have multiple datasets in the same database (by changing the value ofdataset_name
)Edited by Fabio Frazaoadded Request label
Solved with d69ca1ee