-
Notifications
You must be signed in to change notification settings - Fork 7.1k
bug in RandomCrop when accepting a tuple as padding using python 3 #488
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
Comments
KovenYu
added a commit
to KovenYu/vision
that referenced
this issue
May 6, 2018
KovenYu
added a commit
to KovenYu/vision
that referenced
this issue
May 20, 2018
KovenYu
added a commit
to KovenYu/vision
that referenced
this issue
May 21, 2018
KovenYu
added a commit
to KovenYu/vision
that referenced
this issue
May 27, 2018
varunagrawal
pushed a commit
to varunagrawal/vision
that referenced
this issue
Jul 23, 2018
* fix a bug described in issue pytorch#488 * improve doc described in issue pytorch#488 * add arguments in RandomCrop as proposed by vfdev-5 in PR pytorch#489
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when RandomCrop accepts a tuple of integers as padding, it simply absorbs this argument:
then, when it is called, this argument is compared with 0:
this is okay in python 2 where this comparison always returns True. but in python 3, comparison between tuple and int is illegal, and thus it will raise an type error.
P.S. there is another confusing feature. when I use
RandomCrop((128, 32), padding=(16, 4))
, I obviously expect each entry of padding should match the corresponding entry in size (i.e. the height 128 should be padded with 16, and width 32 padded with 4), but in fact it is inverse (128 with 4, 32 with 16). I think this is weird...The text was updated successfully, but these errors were encountered: