Giter Club home page Giter Club logo

Comments (9)

JulesBelveze avatar JulesBelveze commented on July 23, 2024 2

+1

from optimizer.

daquexian avatar daquexian commented on July 23, 2024

Great! I'll support it soon

from optimizer.

sumo2017 avatar sumo2017 commented on July 23, 2024

I also encounter this problem

from optimizer.

Ponyo1 avatar Ponyo1 commented on July 23, 2024

me too

from optimizer.

bigbenbird avatar bigbenbird commented on July 23, 2024

me too. Is anybody working on in ?

from optimizer.

kenny-reyes avatar kenny-reyes commented on July 23, 2024

I am trying converting a model whose size in .pkl is 985 MB, after converting with sklearn-onnx (convert was successful)

Connected to pydev debugger (build 213.7172.26)
[convert_sklearn] parse_sklearn_model
[convert_sklearn] convert_topology
[convert_operators] begin
[convert_operators] iteration 1 - n_vars=0 n_ops=3
[call_converter] call converter for 'SklearnScaler'.
[call_converter] call converter for 'SklearnRandomForestClassifier'.
[call_converter] call converter for 'SklearnZipMap'.
[convert_operators] end iter: 1 - n_vars=6
[convert_operators] iteration 2 - n_vars=6 n_ops=3
[convert_operators] end iter: 2 - n_vars=6
[convert_operators] end.
[_update_domain_version] +opset 0: name='', version=9
[_update_domain_version] +opset 1: name='ai.onnx.ml', version=1
[convert_sklearn] end

Process finished with exit code 1

but then trying to save the onnx model with:

onnx.save(onx, "model.onnx", save_as_external_data=True)

and response

Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2021.3\plugins\python\helpers\pydev\pydevd.py", line 1483, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 2021.3\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Workspace/OnnxTest/pklconversion.py", line 126, in <module>
    onnx.save(onx, "bonus_model.onnx", save_as_external_data=True)
  File "C:\Users\....\AppData\Local\Programs\Python\Python37\lib\site-packages\onnx\__init__.py", line 202, in save_model
    s = _serialize(proto)
  File "C:\Users\....\AppData\Local\Programs\Python\Python37\lib\site-packages\onnx\__init__.py", line 71, in _serialize
    result = proto.SerializeToString()
ValueError: Message onnx.ModelProto exceeds maximum protobuf size of 2GB: 3354372734

I have been finding a fix for this, but I didn't find anything, the question is: Really isn't any solution and you only can't work with onnx with large models?

Thank you very much

from optimizer.

HSQ79815 avatar HSQ79815 commented on July 23, 2024

Onnx-ptimizer has supported large model(exceed 2G). You can install the latest version from source build.

from optimizer.

michaelroyzen avatar michaelroyzen commented on July 23, 2024

@HSQ79815 could you link to a pull request please? I just tried with the latest onnx weekly build and got the same error when trying to export a large model with save_as_external_data=True.

from optimizer.

HSQ79815 avatar HSQ79815 commented on July 23, 2024

@michaelroyzen you could get more information fromm this pr . In the past, Large model(>2G) is loaded by onnx.load(..., load_external_data=True) and saved by onnx.save(..., save_as_external_data=True), while this functions are implemented byPython. We implement c++ load and save function that support large model.

from optimizer.

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.