Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached models only compared by name and tag #12

Open
frauzufall opened this issue Jul 12, 2018 · 4 comments
Open

Cached models only compared by name and tag #12

frauzufall opened this issue Jul 12, 2018 · 4 comments
Assignees

Comments

@frauzufall
Copy link
Member

I have an issue with the current way we load cached models. If one rebuilds the model locally or if we update remote networks but keep the name, the plugin will still use the old cached one because we just compare the file name and tag (right?). What would be the best way to do it? Are hash sums not appropriate for some reason? Could we at least check for a changed file timestamp? I can implement it, just asking for the best strategy or if I am misunderstanding something.

@ctrueden
Copy link
Member

The download service does compare checksums, if they exist. See here.

The DiskCacheService implementation here does implement checking saving and loading, but saving checksums does not happen automatically. Try calling the saveChecksum method manually in your code? Note that I did not test this feature thoroughly, so there may be obstacles, but I believe the pieces you need are there.

@frauzufall
Copy link
Member Author

Oh I see. I was at the wrong position in the code.. I do not see the DiskCacheService being called anywhere in this repository. The DownloadService is also not being called if the directory for the model in the cached folder already exists (code. So I cannot find a way where checksums are being compared even if they existed.

@frauzufall
Copy link
Member Author

Quick solution:

  • add JavaDoc to reflect that the model name defines the model and cache location
  • add method to invalidate cache

Long term solution:

  • use DownloadService to check if model source changed
  • make sure the model cache gets updated once the source changes (e.g. with datestamp)

@frauzufall frauzufall self-assigned this Jul 2, 2019
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/tensorflow-model-downloading/40514/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants