-
Notifications
You must be signed in to change notification settings - Fork 83
ML: Add CPU fallback if GPU fails. LabelImages: allow user to select color of selected annotation. #859
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
Conversation
…ack on CPU if GPU fails.
|
|
||
| output_image_embedding.clear(); | ||
| embedding_session.run(resized_mat, output_image_embedding); | ||
| while (true){ |
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.
while true feels dangerous to me. Can you rewrite it to avoid while(true)?
| m_yolo_session->run(frame_mat_rgb, m_output_boxes); | ||
|
|
||
| // fall back to CPU if fails with GPU. | ||
| for(size_t i = 0;;i++){ |
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.
Same here. Don't use for infinite for loop when you can just have two calls of the session run, one for gpu, and one for cpu if exception is caught.
| #elif _WIN32 | ||
| #define ENABLE_WIN_GPU | ||
| #ifdef ENABLE_WIN_GPU | ||
| if (use_gpu){ |
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.
APPLE's impelemention should be inside this if(use_gpu) as well
No description provided.