Made load_hd5 check blob dims by default, instead of reshaping.#4630
Merged
shelhamer merged 1 commit intoBVLC:masterfrom Mar 8, 2017
Merged
Made load_hd5 check blob dims by default, instead of reshaping.#4630shelhamer merged 1 commit intoBVLC:masterfrom
shelhamer merged 1 commit intoBVLC:masterfrom
Conversation
Contributor
Author
|
@erictzeng |
Contributor
Author
|
This should fix unit tests. |
Contributor
Author
|
The error is because Travis is failing. |
erictzeng
approved these changes
Oct 21, 2016
Contributor
erictzeng
left a comment
There was a problem hiding this comment.
Minor typo that could use fixing, but otherwise this looks good to me.
src/caffe/util/hdf5.cpp
Outdated
| string source_shape_string = stream.str(); | ||
|
|
||
| CHECK(blob_dims == blob->shape()) << "Cannot load blob from hdf5; shape " | ||
| << "missmatch. Source shape is " << source_shape_string |
Contributor
There was a problem hiding this comment.
Minor nit: "missmatch" -> "mismatch"
98a3232 to
95a436c
Compare
Contributor
Author
|
Ok, I squashed. Pending tests its ready. |
Size checks are needed for loading parameters to avoid strange bugs when loading data we continue to reshape.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reason:
Reshaping by default, as done by the
load_hd5function can cause problems. I my case I was:solver.net.load_hdf5(model_fn)solver.test_nets[0].share_with(solver.net)F0825 01:06:18.144207 21739 net.cpp:703] Check failed: target_blobs[j]->shape() == source_blob->shape() Cannot share param 0 weights from layer 'fc6'; shape mismatch. Source param shape is 4096 25088 (102760448); target param shape is 4096 512 7 7 (102760448)This was very confusing, because the actual train net was different from the version shown in the log files. I would expect an when calling
load_hdf5. If I recall this would match the behavior of the protobuf serialization.Open Questions:
hdf5_load_nd_dataset_helperreturn false and the error be throw where we know the layer for which this problem occurred.