Refactor models conversions - #135
Merged
Merged
Conversation
lyuzinmaxim
reviewed
Nov 11, 2025
| - **Configs used:** `configs/resnet18.txt`, `configs/mobilenet.txt` | ||
| - **Engines:** `/workspace/models/deepstream/` | ||
| - **Script used:** `src/validate_deepstream_vs_onnx.py` | ||
| - **Script used:** `src/model_conversion/validate_onnx_vs_pytorch.py` |
Collaborator
There was a problem hiding this comment.
I think it's a mistake - the script for that should be validate_trt_vs_onnx.py
lyuzinmaxim
reviewed
Nov 11, 2025
| do_constant_folding=True, | ||
| ) | ||
|
|
||
| subprocess.run(["python3", "src/model_conversion/validate_onnx_vs_pytorch.py", model_name], check=True) |
Collaborator
There was a problem hiding this comment.
Since both scripts are written in Python, best practice in this case is to import those functions instead of using subprocesses.
Collaborator
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR refactors and renames all model conversion scripts under
src/model_conversion/to ensure consistent naming and structure:export_to_onnx.py→pytorch_to_onnx.pyonnx_validation.py→validate_onnx_vs_pytorch.pyvalidate_deepstream_vs_onnx.py→validate_trt_vs_onnx.pyengine_helper.py→onnx_to_trt.pyThe refactoring maintains identical functionality to the pre-refactored versions.
All imports, file paths, and documentation have been updated accordingly.
Validation confirms that both old and new versions produce identical outputs (console logs, generated files, and results).
closes #131