diff --git a/mace/kernels/reorganize.h b/mace/kernels/reorganize.h index 68c772090d5db75c5cf609da23ea82f2ccc844eb..a64d55b97400188dd99ff4cccbec2b8e92287dc7 100644 --- a/mace/kernels/reorganize.h +++ b/mace/kernels/reorganize.h @@ -74,7 +74,6 @@ struct ReOrganizeFunctor { } } } - } }; diff --git a/mace/python/tools/caffe_converter_lib.py b/mace/python/tools/caffe_converter_lib.py index 7c7cd9abd71cb8b4720f782ffc71835033c3e97c..2cd2107a8dfe486460dfc3b0c78c8e49a9386fee 100644 --- a/mace/python/tools/caffe_converter_lib.py +++ b/mace/python/tools/caffe_converter_lib.py @@ -789,7 +789,6 @@ class CaffeConverter(object): input_shape = op.parents[0].output_shape_map[op.layer.bottom[0]] output_shape = input_shape shape_param = np.asarray(op.layer.reshape_param.shape.dim)[[0, 3, 2, 1]] - print shape_param for i in range(len(shape_param)): if shape_param[i] != 0: output_shape[i] = shape_param[i] diff --git a/tools/mace_tools.py b/tools/mace_tools.py index c9a22f6472e33f8b8245cee9da5796c32d5d5e1d..4f2b209a700439fffd6f466551c0dffceb555805 100644 --- a/tools/mace_tools.py +++ b/tools/mace_tools.py @@ -76,26 +76,28 @@ def generate_random_input(target_soc, model_output_dir, target_soc, model_output_dir, int(generate_data_or_not)) run_command(command) - input_name_list = [] input_file_list = [] - if isinstance(input_names, list): - input_name_list.extend(input_names) - else: - input_name_list.append(input_names) if isinstance(input_files, list): input_file_list.extend(input_files) else: input_file_list.append(input_files) - assert len(input_file_list) == len(input_name_list) - for i in range(len(input_file_list)): - if input_file_list[i] is not None: - dst_input_file = model_output_dir + '/' + input_file_name(input_name_list[i]) - if input_file_list[i].startswith("http://") or \ - input_file_list[i].startswith("https://"): - urllib.urlretrieve(input_file_list[i], dst_input_file) - else: - print 'Copy input data:', dst_input_file - shutil.copy(input_file_list[i], dst_input_file) + if len(input_file_list) != 0: + input_name_list = [] + if isinstance(input_names, list): + input_name_list.extend(input_names) + else: + input_name_list.append(input_names) + if len(input_file_list) != len(input_name_list): + raise Exception('If input_files set, the input files should match the input names.') + for i in range(len(input_file_list)): + if input_file_list[i] is not None: + dst_input_file = model_output_dir + '/' + input_file_name(input_name_list[i]) + if input_file_list[i].startswith("http://") or \ + input_file_list[i].startswith("https://"): + urllib.urlretrieve(input_file_list[i], dst_input_file) + else: + print 'Copy input data:', dst_input_file + shutil.copy(input_file_list[i], dst_input_file) def generate_model_code(): command = "bash tools/generate_model_code.sh"