那么,离线管线缓存呢?
最重要的问题,这个离线缓存如何保持兼容性?系统或驱动升级不兼容,换硬件不兼容,缓存文件损坏如何处理等等 …
pip install onnxruntime-directml https://github.com/microsoft/DirectML
https://onnxruntime.ai/docs/execution-providers/DirectML-ExecutionProvider.html
https://github.com/fdwr/OnnxRuntimeDirectMLEPSample
https://www.nuget.org/packages/Microsoft.AI.DirectML/ 1.13.0 https://www.nuget.org/packages/Microsoft.ML.OnnxRuntime.DirectML/ 1.16.3
https://github.com/microsoft/onnxruntime-inference-examples
https://github.com/microsoft/onnxruntime-inference-examples/tree/main/c_cxx/fns_candy_style_transfer
int8 量化是利用 int8 乘法替换 float32 乘法实现性能加速的一种方法。 note 本文主要描述了 NCNN 中的量化工具操作过程,首先 NCNN 的量化工具包含两部分,ncnn2table 和 ncnn2int8;
在进行 ncnn2int8 量化过程之前需要进行 ncnn2table 操作,生成量化表;
下面首先介绍量化表的生成步骤:
一、ncnn2table 生成量化表
二、ncnn2int8 量化网络模型
F:
cd F:\ncnnbuild
mkdir protobuf_build_MT64
cd protobuf_build_MT64
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=ON ../protobuf-3.11.2/cmake
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release -j 2
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release --target install
F:
cd F:\ncnnbuild
mkdir ncnn_build_MT64
cd ncnn_build_MT64
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_DIR=F:/ncnnbuild/protobuf_build_MT64/install/cmake -DNCNN_SHARED_LIB=ON -DNCNN_VULKAN=ON ../ncnn
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release -j 2
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release --target install
手工替换:<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
为 MT。
这个脚本貌似没生效?!
# In case we are building static libraries, link also the runtime library statically
# so that MSVCR*.DLL is not required at runtime.
# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
# This is achieved by replacing msvc option /MD with /MT and /MDd with /MTd
# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
if (MSVC)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if (${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
endif (MSVC)
F:
cd F:\ncnnbuild
mkdir protobuf_build_MT32
cd protobuf_build_MT32
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 16 2019" -A Win32 -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=ON ../protobuf-3.11.2/cmake
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release -j 2
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release --target install
F:
cd F:\ncnnbuild
mkdir ncnn_build_MT32
cd ncnn_build_MT32
"C:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 16 2019" -A Win32 -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_DIR=F:/ncnnbuild/protobuf_build_MT32/install/cmake -DNCNN_SHARED_LIB=ON -DNCNN_VULKAN=OFF ../ncnn
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release -j 2
"C:\Program Files\CMake\bin\cmake.exe" --build . --config Release --target install
手工替换:<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
为 MT。
ncnn-20240102-windows-vs2019-shared\x64mt_vulkan ncnn-20240102-windows-vs2019-shared\x86mt
https://blog.csdn.net/Leo_whj/article/details/109736449
https://github.com/microsoft/onnxruntime/issues/15025 @skottmckay @fdwr "Windows builds are not compatible with Windows 8.x in this release. Please use v1.11 for now." great news, I looked dependency walker with onnxruntime.dll v1.11.1, it seems it doesn't depends on api-ms-win-core-heap-l2-1-0.dll.
https://github.com/microsoft/onnxruntime/pull/10796 You can implement it yourself to support Windows 7. The issue is resolved here: 可以自己实现,以支持 win7,这里解决了:https://github.com/yycmagic/onnxruntime-for-win7
支持 win7 系统的 onnxruntime https://blog.csdn.net/huang1600301017/article/details/144300007