diff options
author | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2016-02-29 21:15:56 -0800 |
---|---|---|
committer | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2016-02-29 21:22:15 -0800 |
commit | effa9411ca270f32730400861c08dd2aa3f03ffa (patch) | |
tree | 368a20463cf3350eb904f69fc5d1e32f7dd8a3a9 | |
parent | 01d5a9e0afdbdf1e93f343bc5656ad1ec53c1673 (diff) | |
download | caffeonacl-effa9411ca270f32730400861c08dd2aa3f03ffa.tar.gz caffeonacl-effa9411ca270f32730400861c08dd2aa3f03ffa.tar.bz2 caffeonacl-effa9411ca270f32730400861c08dd2aa3f03ffa.zip |
check all net upgrade conditions
check all conditions all the time; V0 -> V1 and V1 -> V2 do not suffice.
-rw-r--r-- | src/caffe/util/upgrade_proto.cpp | 3 | ||||
-rw-r--r-- | tools/upgrade_net_proto_text.cpp | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/caffe/util/upgrade_proto.cpp b/src/caffe/util/upgrade_proto.cpp index 449975bd..775285f1 100644 --- a/src/caffe/util/upgrade_proto.cpp +++ b/src/caffe/util/upgrade_proto.cpp @@ -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) { diff --git a/tools/upgrade_net_proto_text.cpp b/tools/upgrade_net_proto_text.cpp index d8e84d6d..617b48dc 100644 --- a/tools/upgrade_net_proto_text.cpp +++ b/tools/upgrade_net_proto_text.cpp @@ -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); @@ -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]); |