-
Notifications
You must be signed in to change notification settings - Fork 903
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
[KED-2140] Fix issue with saving versioned HDF5 models. #519
Merged
limdauto
merged 3 commits into
kedro-org:master
from
djpetti:fix/tf-model-versioned-hdf5
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised line 115 isn't enough here. 🤔 Do you know more about why that is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Digging into
fsspec
, it looks like this is a peculiarity with how that library works. Specifically, settingauto_mkdir=True
will automatically create the directory, but not immediately. The directory will be created lazily when the_open()
method gets called. However, AFAIK,TensorflowModelDataset._save()
never calls_open()
. For HDF5 files, it eventually callscopy()
, but infsspec
, this merely delegates toshutil.copy()
without calling_open()
. Thus,fsspec
fails to create the parent directory automatically, although, arguably, it should.If you think that this issue would be better fixed in
fsspec
, or that the code here should include aTODO
explaining the situation, I would be amenable to making those alterations.Incidentally, it looks like this issue is resolved in the current
master
branch offsspec
. Maybe the proper resolution here is just to updatefsspec
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's interesting, thank you for the very thorough research!!
Is that a released
fsspec
version? We have a ticket to further relax thefsspec
boundaries to include 0.8.x (0.7.x was a breaking change for us so that bump was done ondevelop
). Do you have time to look into whether that would also fix this issue, and if so we can merge a PR with that update againstdevelop
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cursory glance at the
fsspec
code indicates that the issue is fixed in0.8.0
. It seems, then, that merging the existing PR would indeed fix this issue also. If you agree, I will go and test locally to make sure that the issue is indeed resolved.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case what I'm thinking is:
develop
where we updatefsspec>=0.5.1,<0.9
and remove these 2 lines from theTensorFlowModelDataset
(but keep the unit test because it's useful).@limdauto @djpetti how does that sound?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Should I be handling the second PR too or will someone else do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd like to take that on that would be super helpful! 😊 If not no worries someone in the team can do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can definitely take a crack at this. I might not get to it until tomorrow though.
On a related note, do you have a link to the specific issue for relaxing the
fsspec
version? I would like to be able to reference it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm definitely up for merging this into master as-is for
0.16.6
. Then we can open another PR agaisntdevelop
. I think you can create another PR and reference the discussion in this PR. No need to create another issue for it. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I am comfortable merging as-is.