DeepPoseKit icon indicating copy to clipboard operation
DeepPoseKit copied to clipboard

Make ModelCheckpoint backwards compatible with TF <1.14

Open btcooper22 opened this issue 6 years ago • 3 comments

I attempt to create a ModelCheckpoint callback with the following code:

model_checkpoint = ModelCheckpoint( HOME + "/locust/best_model_SHG.h5", monitor="loss", #monitor="loss" # use if validation_split=0 verbose=1, save_best_only=True, )

Upon running it, the code fails with the following error:

Traceback (most recent call last): File "R:/Locust/bc175/Warren Research Technician/deepposekit/Training.py", line 147, in save_best_only=True, File "R:\Locust\bc175\Warren Research Technician\deepposekit\deepposekit\callbacks.py", line 257, in init **kwargs TypeError: init() got an unexpected keyword argument 'save_freq'

When I remove that code, training works fine, so it's definitely what's causing the issue.

Thanks, Ben

btcooper22 avatar Nov 11 '19 14:11 btcooper22

Thanks for pointing this out. What version of TF are you using? It seems the ModelCheckpoint callback will only work with TF >=1.14. If you're using a version <1.14 I'd recommend upgrading to a newer version. When I get the chance I will update so it's backward compatible.

jgraving avatar Nov 11 '19 15:11 jgraving

Thanks - I was using 1.13, upgrading to 2.0.0 sorted the problem!

btcooper22 avatar Nov 11 '19 15:11 btcooper22

Glad it's working. I'm going to reopen this so I don't forget about it.

jgraving avatar Nov 11 '19 16:11 jgraving