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

fixes thread safety in CustomObjectDetection not working #418

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

GusBricker
Copy link

This change removes the thread_safe flag and instead opts to always make object detection thread safe through the use of tf Sessions. It makes sense to remove the thread_safe flag since we need to setup the Session & Graph beforehand in loadModel() and don't want to introduce a bunch of extra thread_safe flag checks. I added a unit test which runs the custom object detector on 3 threads as well.

More details on the fix here: tensorflow/tensorflow#28287 (comment)

I also locked the tensorflow and keras version down because theres a few bugs in later keras & tensorflow versions that will break threaded detection if tensorflow >2.0 and keras > 2.3.0 are installed. See here: keras-team/keras#13353

This change removes the thread_safe flag because it opts to always make object detection thread safe through the use of tf Sessions. It makes sense to remove the thread_safe flag since we need to setup the Session & Graph beforehand and don't want to introduce a bunch of extra thread_safe checks for no good reason.

More details on the fix here: tensorflow/tensorflow#28287 (comment)
This is to ensure we get compatible versions of the two libraries. At the time of writing, if we let keras install 2.3.1 then we also get a bug which breaks threaded detection. See here for more details: keras-team/keras#13353
fixes keras version typo.
@codecov
Copy link

codecov bot commented Nov 24, 2019

Codecov Report

Merging #418 into master will increase coverage by 0.11%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #418      +/-   ##
==========================================
+ Coverage   49.96%   50.08%   +0.11%     
==========================================
  Files          63       63              
  Lines        5856     5864       +8     
==========================================
+ Hits         2926     2937      +11     
+ Misses       2930     2927       -3

@GusBricker
Copy link
Author

Any feedback on this @OlafenwaMoses or @rola93?

Copy link

@alonilon alonilon left a comment

Choose a reason for hiding this comment

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

looks good !

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.

None yet

2 participants