Skip to content
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

fix(examples): exit program if load_param, load_model failed for clear message #3983

Merged

Conversation

zchrissirhcz
Copy link
Contributor

No description provided.

@zchrissirhcz
Copy link
Contributor Author

zchrissirhcz commented Jul 2, 2022

For #3982

Previously:

(base) ➜  examples git:(examples-early-stop-if-load-models-failed) ✗ ./yolox ./frontground.png
fopen yolox.param failed
fopen yolox.bin failed
find_blob_index_by_name images failed
Try
find_blob_index_by_name output failed
Try
[1]    40373 segmentation fault  ./yolox ./frontground.png

Now:

(base) ➜  examples git:(examples-early-stop-if-load-models-failed) ✗ ./yolox ./frontground.png 
fopen yolox.param failed

This may help people find error with precise message.

Copy link
Member

@nihui nihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load function returns 0 if success
thus, the condition shall check any non-zero value for any potential failure

@zchrissirhcz
Copy link
Contributor Author

Checking zero/nonzero now.
My rebase failed to push to origin, thus made an new commit.

@nihui nihui merged commit c04a1bc into Tencent:master Jul 4, 2022
@nihui
Copy link
Member

nihui commented Jul 4, 2022

Thanks for your contribution !

@zchrissirhcz zchrissirhcz deleted the examples-early-stop-if-load-models-failed branch July 4, 2022 07:03
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.

2 participants