Skip to content

Got an error very recently for "layers.normalizations". Something related to the "epsilon" variable in the typeguard module. #1067

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

Closed
davidweioct opened this issue Feb 11, 2020 · 13 comments
Labels
bug Something isn't working layers style Related to repository's style

Comments

@davidweioct
Copy link

The code was run in google colab with the following install libraries:

!pip3 install nilearn
!pip3 install simpleITK
!pip3 install tensorflow-gpu==2.1.0
!pip3 install tensorflow-addons==0.8.1

ERROR info:

File "/usr/local/lib/python3.6/dist-packages/tensorflow_addons/layers/normalizations.py", line 319, in init
super().init(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/typeguard/init.py", line 809, in wrapper
check_argument_types(memo)
File "/usr/local/lib/python3.6/dist-packages/typeguard/init.py", line 670, in check_argument_types
raise exc from None
File "/usr/local/lib/python3.6/dist-packages/typeguard/init.py", line 668, in check_argument_types
check_type(description, value, expected_type, memo)
File "/usr/local/lib/python3.6/dist-packages/typeguard/init.py", line 598, in check_type
format(argname, qualified_name(expected_type), qualified_name(value)))
TypeError: type of argument "epsilon" must be int; got float instead

Thank you so much!

@davidweioct davidweioct changed the title I recently got an error relateid to the layers.normalizations. Something related to "epsilon" variable in typeguard module. Got an error very recently for "layers.normalizations". Something related to the "epsilon" variable in the typeguard module. Feb 11, 2020
@davidweioct
Copy link
Author

It was running good previously. Not sure if this is due to a recent update.

@davidweioct
Copy link
Author

I used a work-around solution by simply downgrading to 0.7.1

@seanpmorgan
Copy link
Member

@seanpmorgan seanpmorgan reopened this Feb 11, 2020
@seanpmorgan seanpmorgan added bug Something isn't working layers style Related to repository's style labels Feb 11, 2020
@failure-to-thrive
Copy link
Contributor

So isn't it just a change of int to float?

What's the catch?

@seanpmorgan
Copy link
Member

So isn't it just a change of int to float?

What's the catch?

The catch is that we incorrectly typed it as an int. If we have casting then we can make it Union[int, float], but otherwise it should be typed as float

@failure-to-thrive
Copy link
Contributor

I mean, from a workflow point of view. It's a very simple (even "stylish") modification that could be done in no time without a contributors' help. Sorry, I'm just unfamiliar with practices of this project.

@seanpmorgan
Copy link
Member

I mean, from a workflow point of view. It's a very simple (even "stylish") modification that could be done in no time without a contributors' help. Sorry, I'm just unfamiliar with practices of this project.

Addons only consists of volunteer contributors 😄

Please feel free to submit a PR, as you mentioned its an easy fix... and maintainers need to balance reviews, shepparding issues (like this one) and submitting contirbutions....

failure-to-thrive added a commit to failure-to-thrive/addons that referenced this issue Feb 11, 2020
@AakashKumarNain
Copy link
Member

eps should be float only and not int in any case.

@failure-to-thrive
Copy link
Contributor

and maintainers need to balance reviews, shepparding issues (like this one) and submitting contirbutions....

Got it!

gabrieldemarmiesse pushed a commit that referenced this issue Feb 11, 2020
@seanpmorgan
Copy link
Member

and maintainers need to balance reviews, shepparding issues (like this one) and submitting contirbutions....

Got it!

Thanks for the fix!! Encouraging others to fix easy issues also helps grow our contributor base.

Any thoughts on adding this to a 0.8.2 patch version? We could also include the fixes to CohensKappa once that merges.

@gabrieldemarmiesse
Copy link
Member

gabrieldemarmiesse commented Feb 11, 2020

Any thoughts on adding this to a 0.8.2 patch version?

Yes, let's stress test our release process!

Jokes aside, it's a good way to check that the release process is as automatic as possible :)

It would be nice if we had an automatic way of porting bugfix PRs to other branches. I know CPython has a system like that.

seanpmorgan pushed a commit to seanpmorgan/addons that referenced this issue Feb 12, 2020
@davidweioct
Copy link
Author

Thank you for all the information. I understand "epsilon" should be a float simply based on it's definition. I was running in google-colab and not quite family with all those function. Thanks again!

gabrieldemarmiesse pushed a commit that referenced this issue Feb 12, 2020
* Fix kappa (#1047)

* fix kappa
* add more tests and rename regression variable
* add cross_entropy test for binary class model

(cherry picked from commit 83df531)

* Typo in type #1067 (#1069)
(cherry picked from commit 99352d0)

* Bump to 0.8.2

* Add CI to release branches

Co-authored-by: Aakash Kumar Nain <[email protected]>
Co-authored-by: failure-to-thrive <[email protected]>
@seanpmorgan
Copy link
Member

@davidweioct This is fixed in the newly pushed 0.8.2 version

Yes, let's stress test our release process! Jokes aside, it's a good way to check that the release process is as automatic as possible

@gabrieldemarmiesse Super simple 😄 it did launch 3 builds (so I canceled 2) but that's been fixed on master

jrruijli pushed a commit to jrruijli/addons that referenced this issue Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working layers style Related to repository's style
Projects
None yet
Development

No branches or pull requests

5 participants