!20290 fix ssd accuracy degradation

Merge pull request !20290 from 于振华/fix_ssd_master
This commit is contained in:
i-robot 2021-07-15 01:51:10 +00:00 committed by Gitee
commit 8494d56dc0
2 changed files with 7 additions and 11 deletions

View File

@ -67,7 +67,7 @@ int main(int argc, char **argv) {
auto context = std::make_shared<Context>();
auto ascend310 = std::make_shared<mindspore::Ascend310DeviceInfo>();
ascend310->SetDeviceID(FLAGS_device_id);
ascend310->SetBufferOptimizeMode("off_optimize");
ascend310->SetPrecisionMode("allow_fp32_to_fp16");
context->MutableDeviceInfo().push_back(ascend310);
mindspore::Graph graph;
Serialization::Load(FLAGS_mindir_path, ModelType::kMindIR, &graph);

View File

@ -30,7 +30,6 @@ get_real_path(){
}
model=$(get_real_path $1)
data_path=$(get_real_path $2)
DVPP=${3^^}
cfg_path=$4
device_id=0
@ -40,7 +39,7 @@ fi
echo "mindir name: "$model
echo "dataset path: "$data_path
echo "image process mode: "$DVPP
echo "config path: " $cfg_path
echo "device id: "$device_id
export ASCEND_HOME=/usr/local/Ascend/
@ -74,14 +73,11 @@ function infer()
fi
mkdir result_Files
mkdir time_Result
if [ "$DVPP" == "DVPP" ];then
../ascend310_infer/out/main --mindir_path=$model --dataset_path=$data_path --device_id=$device_id --cpu_dvpp=$DVPP --aipp_path=../ascend310_infer/aipp.cfg --image_height=640 --image_width=640 &> infer.log
elif [ "$DVPP" == "CPU" ]; then
../ascend310_infer/out/main --mindir_path=$model --dataset_path=$data_path --cpu_dvpp=$DVPP --device_id=$device_id --image_height=300 --image_width=300 &> infer.log
else
echo "image process mode must be in [DVPP|CPU]"
exit 1
fi
image_shape=`cat ${cfg_path} | grep img_shape`
height=${image_shape:12:3}
width=${image_shape:17:3}
../ascend310_infer/out/main --mindir_path=$model --dataset_path=$data_path --cpu_dvpp=CPU --device_id=$device_id --image_height=$height --image_width=$width &> infer.log
}
function cal_acc()