From 3f3f16e0a78c89e9803fa700c687ad1003b8dd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BD=A6=E5=9B=BD?= Date: Tue, 25 Jul 2023 11:51:07 +0000 Subject: [PATCH 1/3] update ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md. fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙彦国 --- ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e738dd6f3..4e08c3af9 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 - 编译程序 -- Gitee From c2b4040d541198a00e67bebf4c16d619a2c9403f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BD=A6=E5=9B=BD?= Date: Tue, 25 Jul 2023 11:51:47 +0000 Subject: [PATCH 2/3] update ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙彦国 --- ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4e08c3af9..3df8eb450 100644 --- a/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Facenet_for_ACL/README.md @@ -112,5 +112,5 @@ atc --framework=3 --model=./facenet_quantized.pb --output=./facenet_quant --soc 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 -- Gitee From 95b456457ccc5fa9d6464341217c0bb493432c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BD=A6=E5=9B=BD?= Date: Tue, 25 Jul 2023 11:52:52 +0000 Subject: [PATCH 3/3] update ACL_TensorFlow/built-in/cv/Facenet_for_ACL/amct_python.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 孙彦国 --- ACL_TensorFlow/built-in/cv/Facenet_for_ACL/amct_python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 a8ce8d880..78b982058 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()) -- Gitee