cderinbogaz / inpredo

Inpredo is a Deep Learning tool which looks into financial charts and predicts stock movements.
https://towardsdatascience.com/making-a-i-that-looks-into-trade-charts-62e7d51edcba
MIT License
159 stars 93 forks source 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" #14

Open NickRusso-os opened 4 years ago

NickRusso-os commented 4 years ago

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

chrishsr commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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)