KaiyangZhou / deep-person-reid

Torchreid: Deep learning person re-identification in PyTorch.
https://kaiyangzhou.github.io/deep-person-reid/
MIT License
4.24k stars 1.14k forks source link

UserWarning: Cython evaluation #387

Open igoryash-kudryash opened 3 years ago

igoryash-kudryash commented 3 years ago

When I try to impor torchereid I got this Warning Cython evaluation (very fast so highly recommended) is unavailable, now use python evaluation. I have tried some solutions (e.g. https://github.com/KaiyangZhou/deep-person-reid/issues/160). The thing is, when I import torchreid second time in a row, I do not get this Warning, but the calculus are still very slow (like there is no Cython). P.S. I work in Google Colab. Could this be causing the problem? P.P.S. the results of test_cython.py: 1

KaiyangZhou commented 3 years ago

it's a rare case I'd say

I'm not sure whether the problem is caused by colab (probably not)

can you make sure cython is indeed not used? this can be done by adding a printing function to the code to make sure if cython is unused

and if possible, please explain how this error can be reproduced so it's easier for debugging

igoryash-kudryash commented 3 years ago

That is the way I install all packages and etc. (I do not create virtual env cus I do not think it is necessary in Google Colab, but I believe it does not cause the problem). I already restarted runtime and skipped the output. 11 22

So when I execute cell with setup.py I do not have any problems with Cython

1

Then I execute import torchreid 2

And if I execute it again, I do not get any output, but I wrote this part in rank.py

try:
    from torchreid.metrics.rank_cylib.rank_cy import evaluate_cy
    IS_CYTHON_AVAI = True
    print(IS_CYTHON_AVAI, "$$$$$$ in try $$$$$") # T H I S
except ImportError:
    IS_CYTHON_AVAI = False
    print(IS_CYTHON_AVAI, "~~~~~ in except ~~~~~~") # T H I S
    warnings.warn(
        "Cython evaluation (very fast so highly recommended) is "
        "unavailable, now use python evaluation."
    )