Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is a problem because of the python enviroment you are using. Change the target directory to the exact location instead of a relative path as in the example. For example: "YOUR_PATH_TO_MODELS_FOLDER/models/weights-improvement-{epoch:02d}-{val_acc:2f}.hdf5" #14

Open
NickRusso-os opened this issue Oct 22, 2020 · 3 comments

Comments

@NickRusso-os
Copy link

This is a problem because of the python enviroment you are using. Change the target directory to the exact location instead of a relative path as in the example. For example: "YOUR_PATH_TO_MODELS_FOLDER/models/weights-improvement-{epoch:02d}-{val_acc:2f}.hdf5"

Just go the the folder and check for properties by right clicking and copy the path you see over there to this line.

Originally posted by @cderinbogaz in #11 (comment)

Hello, I added my directory as you specified and still receive the same error

@chrishsr
Copy link

same issue, no clue how to solve it. i printed the format string, and it just says"../models/weights-improvement-{epoch:02d}-{val_acc:.2f}.hdf5" so it doesn't format the string properly

@moozgoos
Copy link

moozgoos commented Dec 5, 2020

I am using something like this

metric = 'acc'
target_dir = "../models/weights-improvement/"
if not os.path.exists(target_dir):
os.mkdir(target_dir)
model.save('../models/model')
model.save_weights('../models/weights')

checkpoint = ModelCheckpoint(filepath=target_dir + 'weights-improvement-{epoch:02d}-{acc:.2f}.hdf5', monitor=metric,
verbose=2, save_best_only=True, mode='max')

and it works fine in Windows 10.

@tomitan100
Copy link

I am using something like this

metric = 'acc'
target_dir = "../models/weights-improvement/"
if not os.path.exists(target_dir):
os.mkdir(target_dir)
model.save('../models/model')
model.save_weights('../models/weights')

checkpoint = ModelCheckpoint(filepath=target_dir + 'weights-improvement-{epoch:02d}-{acc:.2f}.hdf5', monitor=metric,
verbose=2, save_best_only=True, mode='max')

and it works fine in Windows 10.

Unless you already have "models" directory, best to use os.makedirs(target_dir)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants