Skip to content

Comments

Fix division operator for Compatibility of python 3 in classifier.py#5900

Merged
longjon merged 1 commit intoBVLC:masterfrom
wasnot:fix/py3-division-compat
Sep 6, 2017
Merged

Fix division operator for Compatibility of python 3 in classifier.py#5900
longjon merged 1 commit intoBVLC:masterfrom
wasnot:fix/py3-division-compat

Conversation

@wasnot
Copy link
Contributor

@wasnot wasnot commented Sep 6, 2017

On python 3, Classifier's predict () method is failed on image reshape, because using float division(/) on the reshape of the image at oversample.
On python 2, division operator / is integer division. But on python 3, / is float division and // is integer division(floored division).
And // division operator is compatible with python 2.

So, I replaced to integer division (//) which is compatible with both python 2/3.

@longjon longjon merged commit ea455eb into BVLC:master Sep 6, 2017
@longjon
Copy link
Contributor

longjon commented Sep 6, 2017

This is the correct thing to do, thanks!

(Unrelatedly, at least one of our tests seems to be failing nondeterministically ಠ_ಠ)

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.

2 participants