Skip to content

Commit

Permalink
net upgrade: skip caffemodel input conversion
Browse files Browse the repository at this point in the history
The caffemodel does not need input conversion and attempting to convert
causes a crash.

Fix BVLC#3750
  • Loading branch information
shelhamer committed Feb 29, 2016
1 parent e5315fe commit 5d7f33c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/caffe/util/upgrade_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,10 @@ const char* UpgradeV1LayerType(const V1LayerParameter_LayerType type) {
}

bool NetNeedsInputUpgrade(const NetParameter& net_param) {
return net_param.input_size() > 0;
// Check that for input field and shape/dim field combination to identify
// the definition/prototxt. The weights/caffemodel has input alone.
return net_param.input_size() > 0 &&
(net_param.input_shape_size() > 0 || net_param.input_dim_size() > 0);
}

void UpgradeNetInput(NetParameter* net_param) {
Expand Down

0 comments on commit 5d7f33c

Please sign in to comment.