Skip to content

fix: find the exported engine next to the source model - #135

Open
gh-underfoot581 wants to merge 1 commit into
ack00gar:mainfrom
gh-underfoot581:fix/tensorrt-engine-location
Open

fix: find the exported engine next to the source model#135
gh-underfoot581 wants to merge 1 commit into
ack00gar:mainfrom
gh-underfoot581:fix/tensorrt-engine-location

Conversation

@gh-underfoot581

Copy link
Copy Markdown

Ultralytics writes the .engine next to the .pt it exported, which is not always the output_dir passed in. Only output_dir was checked, so a successful export could be reported as No engine file was created while the engine sat beside the model.

  • Check beside the source model as well as the output directory
  • Move the engine into the output directory when it lands beside the model
  • Name both checked paths in the failure message

I hit this on Windows with an NVIDIA GPU: the export ran to completion and was still reported as producing nothing.

I also called export_model() directly with ultralytics.YOLO.export stubbed to write the .engine beside the .pt:

case before after
output_dir differs from the .pt directory success=False, "No engine file was created" success=True, engine moved into output_dir
output_dir is the .pt directory success=True success=True, unchanged
export produces no engine success=False success=False, message names both paths checked

Ultralytics writes the .engine beside the .pt it exported, which is not
always the output directory the caller asked for. Only that directory
was checked, so a perfectly good export was reported as "No engine file
was created".

Check beside the model too, and move the file into the output directory
when it turns up there. The failure message now names both paths it
looked in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant