Skip to content

Commit

Permalink
check all net upgrade conditions
Browse files Browse the repository at this point in the history
check all conditions all the time; V0 -> V1 and V1 -> V2 do not suffice.
  • Loading branch information
shelhamer authored and Sven Eberhardt committed Apr 6, 2016
1 parent 7133cf6 commit 283fe12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/caffe/util/upgrade_proto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
namespace caffe {

bool NetNeedsUpgrade(const NetParameter& net_param) {
return NetNeedsV0ToV1Upgrade(net_param) || NetNeedsV1ToV2Upgrade(net_param);
return NetNeedsV0ToV1Upgrade(net_param) || NetNeedsV1ToV2Upgrade(net_param)
|| NetNeedsDataUpgrade(net_param) || NetNeedsInputUpgrade(net_param);
}

bool UpgradeNetAsNeeded(const string& param_file, NetParameter* param) {
Expand Down
5 changes: 0 additions & 5 deletions tools/upgrade_net_proto_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ int main(int argc, char** argv) {
return 2;
}
bool need_upgrade = NetNeedsUpgrade(net_param);
bool need_data_upgrade = NetNeedsDataUpgrade(net_param);
bool success = true;
if (need_upgrade) {
success = UpgradeNetAsNeeded(input_filename, &net_param);
Expand All @@ -44,10 +43,6 @@ int main(int argc, char** argv) {
LOG(ERROR) << "File already in latest proto format: " << input_filename;
}

if (need_data_upgrade) {
UpgradeNetDataTransformation(&net_param);
}

// Save new format prototxt.
WriteProtoToTextFile(net_param, argv[2]);

Expand Down

0 comments on commit 283fe12

Please sign in to comment.