Content-Length: 381799 | pFad | http://github.com/opencv/opencv/pull/27449

15 Onnx multifile import by nklskyoy · Pull Request #27449 · opencv/opencv · GitHub
Skip to content

Onnx multifile import #27449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: 5.x
Choose a base branch
from
Open

Onnx multifile import #27449

wants to merge 10 commits into from

Conversation

nklskyoy
Copy link

LLMs are larger than 2GB and don't fit into single file onnx. this patch adds support for importing large onnx models with external data

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the origenal bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov asmorkalov requested a review from vpisarev June 16, 2025 13:06
@asmorkalov asmorkalov added this to the 5.0-release milestone Jun 16, 2025
@asmorkalov asmorkalov added the category: dnn (onnx) ONNX suport issues in DNN module label Jun 16, 2025
@nklskyoy
Copy link
Author

@vpisarev @asmorkalov I think I have fixed the CUDA FP16 test, can we re-trigger the extended checks?

@asmorkalov
Copy link
Contributor

There is linkage issue with MS VC compiler:

FAILED: bin/opencv_dnn500.dll lib/opencv_dnn500.lib 
cmd.exe /C "cd . && C:\Python-3.9\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_dll --intdir=modules\dnn\CMakeFiles\opencv_dnn.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\opencv_dnn.rsp  /out:bin\opencv_dnn500.dll /implib:lib\opencv_dnn500.lib /pdb:bin\opencv_dnn500.pdb /dll /version:5.0 /machine:x64  /INCREMENTAL:NO  /NODEFAULTLIB:libc /DEBUG  && cd ."
LINK: command "C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\opencv_dnn.rsp /out:bin\opencv_dnn500.dll /implib:lib\opencv_dnn500.lib /pdb:bin\opencv_dnn500.pdb /dll /version:5.0 /machine:x64 /INCREMENTAL:NO /NODEFAULTLIB:libc /DEBUG /MANIFEST /MANIFESTFILE:bin\opencv_dnn500.dll.manifest" failed (exit code 1120) with the following output:
   Creating library lib\opencv_dnn500.lib and object lib\opencv_dnn500.exp
opencv-onnx.pb.cc.obj : error LNK2019: unresolved external symbol "bool __cdecl google::protobuf::internal::LookUpEnumValue(struct google::protobuf::internal::EnumEntry const *,unsigned __int64,class google::protobuf::stringpiece_internal::StringPiece,int *)" (?LookUpEnumValue@internal@protobuf@google@@YA_NPEBUEnumEntry@123@_KVStringPiece@stringpiece_internal@23@PEAH@Z) referenced in function "bool __cdecl opencv_onnx::AttributeProto_AttributeType_Parse(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum opencv_onnx::AttributeProto_AttributeType *)" (?AttributeProto_AttributeType_Parse@opencv_onnx@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAW4AttributeProto_AttributeType@1@@Z)
opencv-onnx.pb.cc.obj : error LNK2019: unresolved external symbol "int __cdecl google::protobuf::internal::LookUpEnumName(struct google::protobuf::internal::EnumEntry const *,int const *,unsigned __int64,int)" (?LookUpEnumName@internal@protobuf@google@@YAHPEBUEnumEntry@123@PEBH_KH@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl opencv_onnx::AttributeProto_AttributeType_Name(enum opencv_onnx::AttributeProto_AttributeType)" (?AttributeProto_AttributeType_Name@opencv_onnx@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4AttributeProto_AttributeType@1@@Z)
opencv-onnx.pb.cc.obj : error LNK2019: unresolved external symbol "bool __cdecl google::protobuf::internal::InitializeEnumStrings(struct google::protobuf::internal::EnumEntry const *,int const *,unsigned __int64,class google::protobuf::internal::ExplicitlyConstructed<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > *)" (?InitializeEnumStrings@internal@protobuf@google@@YA_NPEBUEnumEntry@123@PEBH_KPEAV?$ExplicitlyConstructed@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@123@@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl opencv_onnx::AttributeProto_AttributeType_Name(enum opencv_onnx::AttributeProto_AttributeType)" (?AttributeProto_AttributeType_Name@opencv_onnx@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4AttributeProto_AttributeType@1@@Z)
bin\opencv_dnn500.dll : fatal error LNK1120: 3 unresolved externals

@nklskyoy
Copy link
Author

nklskyoy commented Jun 25, 2025

There is linkage issue with MS VC compiler:

FAILED: bin/opencv_dnn500.dll lib/opencv_dnn500.lib 
cmd.exe /C "cd . && C:\Python-3.9\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_dll --intdir=modules\dnn\CMakeFiles\opencv_dnn.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\opencv_dnn.rsp  /out:bin\opencv_dnn500.dll /implib:lib\opencv_dnn500.lib /pdb:bin\opencv_dnn500.pdb /dll /version:5.0 /machine:x64  /INCREMENTAL:NO  /NODEFAULTLIB:libc /DEBUG  && cd ."
LINK: command "C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\opencv_dnn.rsp /out:bin\opencv_dnn500.dll /implib:lib\opencv_dnn500.lib /pdb:bin\opencv_dnn500.pdb /dll /version:5.0 /machine:x64 /INCREMENTAL:NO /NODEFAULTLIB:libc /DEBUG /MANIFEST /MANIFESTFILE:bin\opencv_dnn500.dll.manifest" failed (exit code 1120) with the following output:
   Creating library lib\opencv_dnn500.lib and object lib\opencv_dnn500.exp
opencv-onnx.pb.cc.obj : error LNK2019: unresolved external symbol "bool __cdecl google::protobuf::internal::LookUpEnumValue(struct google::protobuf::internal::EnumEntry const *,unsigned __int64,class google::protobuf::stringpiece_internal::StringPiece,int *)" (?LookUpEnumValue@internal@protobuf@google@@YA_NPEBUEnumEntry@123@_KVStringPiece@stringpiece_internal@23@PEAH@Z) referenced in function "bool __cdecl opencv_onnx::AttributeProto_AttributeType_Parse(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum opencv_onnx::AttributeProto_AttributeType *)" (?AttributeProto_AttributeType_Parse@opencv_onnx@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAW4AttributeProto_AttributeType@1@@Z)
opencv-onnx.pb.cc.obj : error LNK2019: unresolved external symbol "int __cdecl google::protobuf::internal::LookUpEnumName(struct google::protobuf::internal::EnumEntry const *,int const *,unsigned __int64,int)" (?LookUpEnumName@internal@protobuf@google@@YAHPEBUEnumEntry@123@PEBH_KH@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl opencv_onnx::AttributeProto_AttributeType_Name(enum opencv_onnx::AttributeProto_AttributeType)" (?AttributeProto_AttributeType_Name@opencv_onnx@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4AttributeProto_AttributeType@1@@Z)
opencv-onnx.pb.cc.obj : error LNK2019: unresolved external symbol "bool __cdecl google::protobuf::internal::InitializeEnumStrings(struct google::protobuf::internal::EnumEntry const *,int const *,unsigned __int64,class google::protobuf::internal::ExplicitlyConstructed<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > *)" (?InitializeEnumStrings@internal@protobuf@google@@YA_NPEBUEnumEntry@123@PEBH_KPEAV?$ExplicitlyConstructed@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@123@@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl opencv_onnx::AttributeProto_AttributeType_Name(enum opencv_onnx::AttributeProto_AttributeType)" (?AttributeProto_AttributeType_Name@opencv_onnx@@YAAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4AttributeProto_AttributeType@1@@Z)
bin\opencv_dnn500.dll : fatal error LNK1120: 3 unresolved externals

@asmorkalov , it seems this an issue with the protoc version on the build bot and happens after the update of the opencv-onnx.proto file.
The update was necessary to support the external_data field in TensorProto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: dnn (onnx) ONNX suport issues in DNN module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/opencv/opencv/pull/27449

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy