!18646 yolov3_resnet18 bug fix

Merge pull request !18646 from 张晓晓/bugfix
This commit is contained in:
i-robot 2021-06-22 01:34:06 +00:00 committed by Gitee
commit fba181e0d8
1 changed files with 2 additions and 1 deletions

View File

@ -74,7 +74,7 @@ int PadImage(const MSTensor &input, MSTensor *output) {
widthSize = shape[0]*heightScale;
heightSize = shape[1]*heightScale;
}
std::shared_ptr<TensorTransform> resize(new Resize({widthSize, heightSize}, InterpolationMode::kArea));
std::shared_ptr<TensorTransform> resize(new Resize({widthSize, heightSize}, InterpolationMode::kCubicPil));
Execute composeResize({resize});
Status ret = composeResize(input, &imgResize);
if (ret != kSuccess) {
@ -110,6 +110,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");
context->MutableDeviceInfo().push_back(ascend310);
mindspore::Graph graph;
Serialization::Load(FLAGS_mindir_path, ModelType::kMindIR, &graph);