diff --git a/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md index e738dd6f3a8fb316db58119c1eac89385d03ad44..3df8eb45047c5376baae7ed0c4aa71eb07a13d35 100644 --- a/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md @@ -76,7 +76,7 @@ python3 amct_python.py ./facenet_20180408-102900.pb ./datasets_bin/data_image_bi mv ./quant/facenet_quantized.pb ./ -atc --framework=3 --model=./model/facenet_quantized.pb --output=./model/facenet_quant --soc_version=Ascend310P3 --insert_op_conf=./facenet_tensorflow.cfg --input_format=NHWC --input_shape=input:64,160,160,3 +atc --framework=3 --model=./facenet_quantized.pb --output=./facenet_quant --soc_version=Ascend310P3 --insert_op_conf=./facenet_tensorflow.cfg --input_format=NHWC --input_shape=input:64,160,160,3 - 编译程序 @@ -112,5 +112,5 @@ atc --framework=3 --model=./model/facenet_quantized.pb --output=./model/facenet 3. 精度验证 -python3 post2.py ../datasets ../output/2023_05_11-10_55_20 ../datasets_bin/data_label_bin --lfw_batch_size 1 --distance_metric --use_flipped_images --subtract_mean +python3 post2.py ../datasets ../output/2023_05_11-10_55_20 ../datasets_bin/data_label_bin --lfw_batch_size 1 --distance_metric 1 --use_flipped_images --subtract_mean diff --git a/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/amct_python.py b/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/amct_python.py index a8ce8d88015aa78ba0acd7c1027f268413e53a70..78b982058ea36db89059af2b6cda8fd15ef8cf94 100644 --- a/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/amct_python.py +++ b/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/amct_python.py @@ -13,7 +13,7 @@ def load_bin(bin_path): bin_path_list.sort() for idx in range(100): input = np.fromfile(os.path.join(bin_path, bin_path_list[idx]), np.float32).reshape(160, 160, 3) - bin_path.append(input) + input_list.append(input) return np.array(input_list) @@ -39,9 +39,9 @@ if __name__ == '__main__': with tf.compat.v1.Session() as session: origin_prediction = session.run(output_tensor, feed_dict={input_tensor: input_bin}) config_path = os.path.join(args.output, 'config.json') - amct.create_quant_config(config_path=config_path, graph=graph, skip_layers=[], batch_num=1) + amct.create_quant_config(config_file=config_path, graph=graph, skip_layers=[], batch_num=1) record_path = os.path.join(args.output, 'record,txt') - amct.quantize_model(graph=graph, config_file=config_path, record_path=record_path) + amct.quantize_model(graph=graph, config_file=config_path, record_file=record_path) batch = load_bin(calibration_path) with tf.compat.v1.Session() as session: session.run(tf.compat.v1.global_variables_initializer())