tf2-mobile-2d-single-pose-estimation icon indicating copy to clipboard operation
tf2-mobile-2d-single-pose-estimation copied to clipboard

Convert Eager to Keras fit in training

Open tucan9389 opened this issue 3 years ago • 8 comments

Related script

https://github.com/tucan9389/tf2-mobile-2d-single-pose-estimation/blob/82a01359820c1797505a13bc663df49b717cc696/train.py#L112-L125

tucan9389 avatar Mar 27 '21 06:03 tucan9389

how to convert this above code into model.fit() because model is taking only images as input. Please guide me or any references Thanks

hgoyal194 avatar Sep 23 '21 12:09 hgoyal194

@hgoyal194 i didnt try to keras fit method. if you implement it, I'll appreciate it when you make the PR. The added filename could be like this train_keras.py!

tucan9389 avatar Sep 24 '21 00:09 tucan9389

@hgoyal194 Here are examples for the keras. You can check this! https://keras.io/examples/

tucan9389 avatar Sep 24 '21 00:09 tucan9389

@hgoyal194 i didnt try to keras fit method. if you implement it, I'll appreciate it when you make the PR. The added filename could be like this train_keras.py!

what is PR ?

hgoyal194 avatar Sep 24 '21 06:09 hgoyal194

Related script

https://github.com/tucan9389/tf2-mobile-2d-single-pose-estimation/blob/82a01359820c1797505a13bc663df49b717cc696/train.py#L112-L125

Also, 1.> how to add save and restore checkpoints, 2.> free the memory of previous batches

Thanks

hgoyal194 avatar Sep 24 '21 06:09 hgoyal194

@hgoyal194

i didnt try to keras fit method. if you implement it, I'll appreciate it when you make the PR.

The added filename could be like this train_keras.py!

what is PR ?

check it out 👻

https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests

tucan9389 avatar Sep 24 '21 08:09 tucan9389

Related script

https://github.com/tucan9389/tf2-mobile-2d-single-pose-estimation/blob/82a01359820c1797505a13bc663df49b717cc696/train.py#L112-L125

1.> how to add save and restore checkpoints,

you can check the following guide. https://www.tensorflow.org/tutorials/keras/save_and_load

and you can also search the basic of the tensorflow's usage at google. if you dont know about any keyword or what you need to start, please tell me.

2.> free the memory of previous batches

i dont know about it. is there any memory issue in this code? if yes, can you show me the profiled memory debugging screen or error message?

thanks

tucan9389 avatar Sep 24 '21 08:09 tucan9389

memory issue is like I need to train the model on batchsize=8, my pc specs ubuntu Intel® Core™ i5-6600T CPU @ 2.70GHz × 4 ram -8 gb no dedicated gpu

for training, It's only running on CPU ram. memory is stacking up after some time of training and after random step it's automatic "killed" I tried batch_size =32 ,16 always get out o memory batch_size = 8 memory is filled up 85% and swap is 98%. I can't do any other thing if training is going on.

how to free memory in prefetch_dataset you used or any other process

hgoyal194 avatar Sep 24 '21 09:09 hgoyal194