-
Notifications
You must be signed in to change notification settings - Fork 330
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
[Port] OD layers to Keras 3 #2295
[Port] OD layers to Keras 3 #2295
Conversation
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.
There are certain blockers that I need some guidance on:
with tf.name_scope("multilevel_crop_and_resize")
tf.constant
tf.math.divide_no_nan
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.
What's the blocker exactly?
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.
I meant -- how should I be porting the above mentioned APIs to Keras3.
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.
I don't think you require name scoping. For constant
, use KerasTensor? For third one, just write a custom divide function. Though we should add it in the core actually
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.
Thanks for the tips @AakashKumarNain
I am documenting what I did:
- Removed scopes
- Used
ops.convert_to_tensor
or usedops.ones
multiplying a scalar to it - Use
ops.cond
for the divide no nan
note: the nms bit reproduces -1 instead of 0
@divyashreepathihalli Could you check the port of |
Thanks @ariG23498! roi_align and roi_generator LGTM!! |
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.
LGTM! Thank you.
Thanks for the updates @ariG23498. There is one failing test
|
Hey @divyashreepathihalli do you think this one has to do with the |
@divyashreepathihalli @AakashKumarNain I have created a gist to explain the failing test One can notice that the tests are flaky due to the radom API for |
@ariG23498 the randomAPI has changed and these tests can be fllaky. Please disable the test and add and issue and add a todo in the code. |
I have made the changes requested. I am also adding the link of the issue to this thread. |
Please rebase for the fix - #2360 ! |
removed vectorized map as it was not working for jax and torch used ops convert_to_numpy in tests to make np operations work on torch tensor
Great work on this @ariG23498! this work is very impactful! Thank you!! |
TODOs:
roi_align.py
roi_generator.py
roi_pool.py
roi_sampler.py
rpn_label_encoder.py
CC: @divyashreepathihalli