gmalivenko / onnx-opcounter

Count number of parameters / MACs / FLOPS for ONNX models.
Apache License 2.0
89 stars 21 forks source link

ValueError: Message onnx.ModelProto exceeds maximum protobuf size of 2GB: 26972694926 #4

Open hupreti opened 1 year ago

hupreti commented 1 year ago

Command used onnx_onnx_opcounter --calculate-macs <path/to/onnx/model>

Traceback (most recent call last): File "/env/bin/onnx_opcounter", line 8, in sys.exit(main()) File "/env/lib/python3.8/site-packages/onnx_opcounter/cli.py", line 17, in main print('Number of MACs in the model: {}'.format(calculate_macs(model))) File "/env/lib/python3.8/site-packages/onnx_opcounter/onnx_opcounter.py", line 88, in calculate_macs onnx.save(model, '+all-intermediate.onnx') File "/env/lib/python3.8/site-packages/onnx/init.py", line 197, in save_model s = _serialize(proto) File "/env/lib/python3.8/site-packages/onnx/init.py", line 66, in _serialize result = proto.SerializeToString() ValueError: Message onnx.ModelProto exceeds maximum protobuf size of 2GB: 26972694926