tucan9389 / tf2-mobile-2d-single-pose-estimation

:dancer: Pose estimation for iOS and android using TensorFlow 2.0
Apache License 2.0
168 stars 41 forks source link

Convert Eager to Keras fit in training #62

Open tucan9389 opened 3 years ago

tucan9389 commented 3 years ago

Related script

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

hgoyal194 commented 3 years ago

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

tucan9389 commented 3 years ago

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

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

hgoyal194 commented 3 years ago

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

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

tucan9389 commented 3 years ago

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

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

hgoyal194 commented 3 years ago

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