inpredo icon indicating copy to clipboard operation
inpredo copied to clipboard

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"

Open NickRusso-os opened this issue 4 years ago • 3 comments

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 https://github.com/cderinbogaz/inpredo/issues/11#issuecomment-705474797

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

NickRusso-os avatar Oct 22 '20 16:10 NickRusso-os

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

chrishsr avatar Nov 22 '20 20:11 chrishsr

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.

moozgoos avatar Dec 05 '20 06:12 moozgoos

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)

tomitan100 avatar Mar 12 '21 14:03 tomitan100