Giter Site home page Giter Site logo

Comments (5)

jxt1234 avatar jxt1234 commented on June 14, 2024

机器是 x64-avx2 ? 最新版本上结果对么?

from mnn.

cythamubis avatar cythamubis commented on June 14, 2024

机器是 x64-avx2 ? 最新版本上结果对么?

处理器amd r7 6800H ,要怎么样知道MNN是否使用avx2指令集? 最新版本结果和当前情况一样

from mnn.

cythamubis avatar cythamubis commented on June 14, 2024

@jxt1234
testMNNFromONNX加debug后显示First Error Node is : Resize_709, 模型里的UpsampleLayer使用bicubic插值

部分cpp代码如下

//配置
MNN::BackendConfig backendConfig;
backendConfig.precision = backendConfig.Precision_Low; 
backendConfig.memory = backendConfig.Memory_High;
backendConfig.power = backendConfig.Power_Normal;

MNN::ScheduleConfig config;
config.numThread = 4;
config.backendConfig = &backendConfig;
config.type = typeengine;

exe->setGlobalExecutorConfig(typeengine, backendConfig, 4);

rtmgr = std::shared_ptr<Executor::RuntimeManager>(Executor::RuntimeManager::createRuntimeManager(config));

encoder.reset(Module::load(std::vector<std::string>{}, std::vector<std::string>{}, encoder_path, rtmgr));
sam.reset(Module::load(sam_input, sam_output, decoder_path, rtmgr));

rtmgr->setCache(".cachefile");

//推理
auto input = MNN::Express::_Input({1, inference_size, inference_size, 3}, MNN::Express::NHWC, halide_type_of<float>());

::memcpy(input->writeMap<float>(), processed_image.data, inference_size * inference_size * 3 * sizeof(float));

input = _Convert(input, MNN::Express::NCHW);

auto st = std::chrono::system_clock::now();
auto outputs = encoder->onForward({ input });
auto et = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(et - st);
printf("# 1. embedding times: %f ms\n", duration.count() * 1e-3);

image_embedding = _Convert(outputs[0], NCHW);

from mnn.

cythamubis avatar cythamubis commented on June 14, 2024

bicubic改成bilinear后结果正常,看到之前有个类似的问题 #1837

from mnn.

jxt1234 avatar jxt1234 commented on June 14, 2024

估计是 bicubic 的 avx2 后端实现有问题,我们检查一下

from mnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.