зеркало из https://github.com/microsoft/caffe.git
Merge pull request #266 from longjon/toomanyargs
Passing too many args to tool binaries is an error
This commit is contained in:
Коммит
bbfaa69df0
|
@ -18,7 +18,7 @@ int main(int argc, char** argv) {
|
|||
::google::InitGoogleLogging(argv[0]);
|
||||
if (argc != 3) {
|
||||
LOG(ERROR) << "Usage: compute_image_mean input_leveldb output_file";
|
||||
return(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
leveldb::DB* db;
|
||||
|
|
|
@ -30,7 +30,7 @@ using std::string;
|
|||
|
||||
int main(int argc, char** argv) {
|
||||
::google::InitGoogleLogging(argv[0]);
|
||||
if (argc < 4) {
|
||||
if (argc < 4 || argc > 5) {
|
||||
printf("Convert a set of images to the leveldb format used\n"
|
||||
"as input for Caffe.\n"
|
||||
"Usage:\n"
|
||||
|
@ -38,7 +38,7 @@ int main(int argc, char** argv) {
|
|||
" RANDOM_SHUFFLE_DATA[0 or 1]\n"
|
||||
"The ImageNet dataset for the training demo is at\n"
|
||||
" http://www.image-net.org/download-images\n");
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
std::ifstream infile(argv[2]);
|
||||
std::vector<std::pair<string, int> > lines;
|
||||
|
|
|
@ -10,7 +10,7 @@ using namespace caffe; // NOLINT(build/namespaces)
|
|||
int main(int argc, char** argv) {
|
||||
if (argc > 2) {
|
||||
LOG(ERROR) << "device_query [device_id=0]";
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
if (argc == 2) {
|
||||
LOG(INFO) << "Querying device_id=" << argv[1];
|
||||
|
|
|
@ -14,9 +14,9 @@ using namespace caffe; // NOLINT(build/namespaces)
|
|||
|
||||
int main(int argc, char** argv) {
|
||||
::google::InitGoogleLogging(argv[0]);
|
||||
if (argc < 2) {
|
||||
if (argc != 3) {
|
||||
LOG(ERROR) << "Usage: finetune_net solver_proto_file pretrained_net";
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
SolverParameter solver_param;
|
||||
|
|
|
@ -22,10 +22,10 @@ using namespace caffe; // NOLINT(build/namespaces)
|
|||
|
||||
int main(int argc, char** argv) {
|
||||
int total_iter = 50;
|
||||
if (argc < 2) {
|
||||
if (argc < 2 || argc > 5) {
|
||||
LOG(ERROR) << "net_speed_benchmark net_proto [iterations=50]"
|
||||
" [CPU/GPU] [Device_id=0]";
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc >=3) {
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
using namespace caffe; // NOLINT(build/namespaces)
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc < 4) {
|
||||
if (argc < 4 || argc > 5) {
|
||||
LOG(ERROR) << "test_net net_proto pretrained_net_proto iterations "
|
||||
<< "[CPU/GPU]";
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
cudaSetDevice(0);
|
||||
|
|
|
@ -15,9 +15,9 @@ using namespace caffe; // NOLINT(build/namespaces)
|
|||
|
||||
int main(int argc, char** argv) {
|
||||
::google::InitGoogleLogging(argv[0]);
|
||||
if (argc < 2) {
|
||||
if (argc < 2 || argc > 3) {
|
||||
LOG(ERROR) << "Usage: train_net solver_proto_file [resume_point_file]";
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
SolverParameter solver_param;
|
||||
|
|
Загрузка…
Ссылка в новой задаче