Skip to content

Large JSON can't be loaded while smaller ones can #11061

@nerd-qp

Description

@nerd-qp
  • OpenCV => ❔ 3.4.1-dev
  • Operating System / Platform => ❔ Ubuntu16.04.4lts
  • Compiler => ❔ g++ 5.4.0
Detailed description

The FileStorage could not handle large JSON file.

OpenCV(3.4.1-dev) Error: Parsing error (../models/svm_0.json(0): Unexpected character) in icvJSONParseSeq, file /home/king-kong/my-repo/action_detect/opencv/modules/core/src/persistence_json.cpp, line 460
error: OpenCV(3.4.1-dev) /home/king-kong/my-repo/action_detect/opencv/modules/core/src/persistence_json.cpp:460: error: (-212) Parsing error: ../models/svm_0.json(0): Unexpected character in function icvJSONParseSeq

OpenCV(3.4.1-dev) Error: Unknown error code -49 (Input file is empty) in cvOpenFileStorage, file /home/king-kong/my-repo/action_detect/opencv/modules/core/src/persistence_c.cpp, line 384
error: OpenCV(3.4.1-dev) /home/king-kong/my-repo/action_detect/opencv/modules/core/src/persistence_c.cpp:384: error: (-49) Unknown error code -49: Input file is empty in function cvOpenFileStorage

And Interestingly, after I split the json file into smaller pieces, the FileStorage is able to handle the json file.

Steps to reproduce

I have the json file and the code here, https://github.com/326623/test/tree/3884c5cd0231abbdc953d10361a0453f4ab4b8f2

Thanks in adanced!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions