-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Caffemodel snapshots with shared weights don't have multiple copies #2946
Conversation
|
They do keep additional copies. This is fixing that. |
This should have been done in #2836; is there something this does that that didn't do? |
I didn't realize HDF5 was the new default. This doesn't do anything more, but it does equivalently what's done for the HDF5s. |
Ah, sorry, I didn't realize #2836 didn't make the analogous change for proto snapshots. I'm not sure about adding an |
Those are good comments, but I'm not sure I agree. For one, I think is_owner is more a property of the layer than of the net itself. I would agree that the blobs should not be responsible for the property. However, if we rename is_owner to write_data, it's pretty obvious to me that write_data and write_diff are nearly identical in form and function. Thus, I think they should be treated equivalently. Secondly, each object should be responsible for the logic of serializing itself. To me that means layer should understand the concept of ownership, and should relay that information to the blobs. Pulling the logic into net would be a mistake that would cause the layer to not be able to encapsulate all of its desired functionality. If anything, I would say it would be more clear to remove the param_owners_ property from net and to put it into each layer individually. |
Thanks for opening this PR; I've just run into the same issue. I do agree with @jeffdonahue here, in particular:
Also, there seems to be a long irrelevant commit history here... please do squash your changes into a single commit (which should be fine here, although a few logically separated commits is also fine). |
The owners of the shared weights keep the parameters around, but the non-owners don't keep additional copies.