-
Notifications
You must be signed in to change notification settings - Fork 22
docs: add FAQ, document in-memory model loading; bump version to 0.8.0 #154
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
Merged
+60
−3
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Frequently Asked Questions | ||
|
|
||
| Common build and runtime questions, distilled from GitHub issues. | ||
|
|
||
| ## Windows: linking fails with `LNK2001: unresolved external symbol __std_find_trivial_8` | ||
|
|
||
| Unresolved `__std_*` symbols (`__std_find_trivial_*`, `__std_max_element_*`, | ||
| `__std_search_*`, ...) mean the linker's MSVC STL is too old. The prebuilt | ||
| ONNX Runtime binaries that `ort-sys` downloads are compiled with Visual | ||
| Studio 2022 (MSVC v143) and reference vectorized STL helpers that do not | ||
| exist in the VS 2019 (v142) link libraries. | ||
|
|
||
| Fix: | ||
|
|
||
| 1. Install **Visual Studio 2022** or **Build Tools for Visual Studio 2022** | ||
| with the "Desktop development with C++" workload (MSVC v143 + Windows SDK). | ||
| 2. Run `cargo clean` and rebuild — rustc picks the newest installed MSVC | ||
| toolset automatically. | ||
|
|
||
| VS 2019 and VS 2022 build tools can coexist; only the newer one needs to be | ||
| present for linking. (See issue [#105](https://github.com/GreatV/oar-ocr/issues/105).) | ||
|
|
||
| ## GPU inference is slower than CPU for PP-OCRv6 tiny/small | ||
|
|
||
| Expected. The tiny/small models are so small that per-call overhead — | ||
| host↔device tensor copies, kernel launches, CPU/GPU synchronization, plus | ||
| pre/post-processing that always runs on the CPU — outweighs the compute the | ||
| GPU saves. Measured on an RTX 4090 + i9-13900KF (single image, warmup | ||
| excluded): | ||
|
|
||
| | Model | CPU | GPU (CUDA EP) | | ||
| | ------ | ---------- | ------------------------- | | ||
| | tiny | 34 ms/img | 44 ms/img | | ||
| | small | 59 ms/img | 77 ms/img | | ||
| | medium | 404 ms/img | **173 ms/img** (2.3× faster) | | ||
|
|
||
| Guidelines: | ||
|
|
||
| - For tiny/small, use the default CPU mode (the `simd` feature is on by default). | ||
| - Use the medium model, or batch several images per `predict()` call, when | ||
| GPU acceleration matters. | ||
| - Exclude the first call when benchmarking: it includes cuDNN initialization | ||
| and algorithm selection (~5× slower than steady state). | ||
|
|
||
| Also note that requesting `OrtExecutionProvider::CUDA` without building with | ||
| `--features cuda` makes the pipeline builder return an error — check the | ||
| `Result` of `.build()`. Without the `cuda` feature, the downloaded ONNX | ||
| Runtime is CPU-only and the GPU is never used. | ||
| (See issue [#151](https://github.com/GreatV/oar-ocr/issues/151).) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this bumps the workspace crates to 0.8.0 while leaving the tracked
Cargo.lockentries foroar-ocr,oar-ocr-core,oar-ocr-derive, andoar-ocr-vlat 0.7.5, locked builds now fail before compiling. I verifiedcargo check --workspace --locked --no-default-featuresexits withcannot update the lock file ... because --locked was passed, andcargo check --helpdefines--lockedas asserting thatCargo.lockremains unchanged; regenerating and committing the lockfile keeps consumers/CI jobs that use locked builds working.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cargo.lockis not tracked in this repository — it is listed in.gitignore(line 8), and neithermainnor this branch contains it (git cat-file -e main:Cargo.lockfails). This is a library workspace, so consumers generate their own lockfile and no CI job here uses--locked. No change needed.