swift-models icon indicating copy to clipboard operation
swift-models copied to clipboard

Add transfer learning support to image classification models

Open rickwierenga opened this issue 4 years ago • 5 comments

It would be super helpful if we could use the predefined models in this repository with pretrained weights for transfer learning like keras-applications does.

rickwierenga avatar Jan 18 '20 09:01 rickwierenga

This is a goal, and it's one reason why we've been working on a robust checkpoint loader. It's also a reason why we've created a Google Cloud Storage bucket for hosting datasets and weights.

My plan is to first finish the checkpoint loader, then initially target loading pretrained weights via TensorFlow v2 checkpoints into our image classification models for accuracy-based inference unit tests. Assuming all models behave as they should in these tests, examples and tests for transfer learning would follow.

Somewhere in this, we'll be building out the second half of the checkpoint loader, a checkpoint writer, which should be helpful for studies of transfer learning.

BradLarson avatar Jan 18 '20 16:01 BradLarson

Great!

rickwierenga avatar Jan 18 '20 18:01 rickwierenga

It would also be great if there are some tutorials regarding Checkpoint reader and writer.

diwakar-vsingh avatar Nov 27 '20 03:11 diwakar-vsingh

It's been a long time. Any progress on this?

RahulBhalley avatar Jan 05 '21 04:01 RahulBhalley

@rahulbhalley - Sorry for the delay. In the time since my last update above, we had implemented the remaining checkpoint reading and writing functionality as basic components. PR #631 ties those together into a hopefully easy-to-use API, and adds documentation and examples for that. I'd also like to rework PR #334 using this new interface, either as part of #631 or a later PR, as a first example of how this could be used.

All tests are now passing in PR #631, but there's a path inconsistency in loading and saving I'd like to correct. For #334, I think we'll also need a checkpoint-specific name mapping interface, so I may need to add that. I'm working on this presently, and would like to get this in soon.

BradLarson avatar Jan 05 '21 14:01 BradLarson