docs(examples): build and document graph.pb generation in infer_water#5699
Conversation
The infer_water README instructed users to run cmake and make, but the resulting inference binaries load a frozen model graph.pb that is gitignored and never generated. The convert_model.c helper that creates it was neither built by CMakeLists.txt nor mentioned in the README, so following the documented steps produced binaries that failed at runtime. Add convert_model as a CMake target and document the full sequence: build, run ./convert_model to generate graph.pb from the bundled test model, then run the inference examples. The README makes clear that make only compiles the executables and that convert_model must be run from the example directory with a TensorFlow-enabled build. Fix deepmodeling#5693
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe infer_water example's CMakeLists.txt now builds a convert_model executable linked against DeePMD::deepmd_c. The README is updated to document building executables, generating graph.pb via convert_model, TensorFlow-backend requirements, and running the inference binaries. Changesconvert_model build and documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Related issues: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5699 +/- ##
==========================================
- Coverage 81.97% 81.78% -0.19%
==========================================
Files 959 959
Lines 105748 105747 -1
Branches 4102 4105 +3
==========================================
- Hits 86684 86483 -201
- Misses 17573 17768 +195
- Partials 1491 1496 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
42de67e
Problem
The
examples/infer_waterREADME tells users to runcmakeandmake, but the resulting inference binaries (infer_water_cc,infer_water_c,infer_water_hpp,infer_water_nlist) load a frozen modelgraph.pbfrom the current directory.graph.pbis gitignored and never generated, and theconvert_model.chelper that creates it is neither built byCMakeLists.txtnor mentioned in the README. Following the documented steps therefore produces binaries that fail at runtime.Fix
Add
convert_modelas a CMake target (it uses onlyDP_ConvertPbtxtToPbfromdeepmd/c_api.h, so it linksDeePMD::deepmd_clike the other C examples) and document the full sequence in the README: build, run./convert_modelto generategraph.pbfrom the bundled test modelsource/tests/infer/deeppot.pbtxt, then run the inference examples. The README makes explicit thatmakeonly compiles the executables and does not create the model file, and thatconvert_modelmust be run from the example directory (so the relative path to the bundled model resolves) with a TensorFlow-enabled build (sincegraph.pbis a TensorFlow frozen model).Test
This is a build/documentation example that is not part of the unit-test suite; a meaningful test would require building the example project against an installed TensorFlow-enabled DeePMD-kit and running the binaries, which is outside the unit scope. The fix is verified by inspection:
convert_model.cincludes onlydeepmd/c_api.h,DP_ConvertPbtxtToPbis a real C-API function, and the bundleddeeppot.pbtxtfixture exists and resolves relative to the example directory.Fix #5693
Summary by CodeRabbit
New Features
Documentation
graph.pbfile and running the available inference binaries.