facebookresearch / fvcore

Collection of common code that's shared among different research projects in FAIR computer vision team.
Apache License 2.0
2k stars 226 forks source link

ValueError: Invalid type <class 'numpy.int32'> for the flop count! Please use a wider type to avoid overflow. #104

Open WYHZQ opened 2 years ago

WYHZQ commented 2 years ago

ValueError: Invalid type <class 'numpy.int32'> for the flop count! Please use a wider type to avoid overflow.

qwert1337 commented 2 years ago

In jit_handles.py prod is producing numpy.int32 if imported from numpy.

Fix: replace

try: from math import prod except ImportError: from numpy import prod

by

try: from math import prod except ImportError: from numpy import prod as prodnp def prod(x): return int(prodnp(x))

ppwwyyxx commented 2 years ago

Please provide code to reproduce the issue.

PilotPhil commented 2 years ago

thanks a lot i can run just modify like what you say!!! Snipaste_2022-07-28_01-02-55

scau-gqw1993 commented 2 years ago

Thanks a lot

blackseven-white commented 3 months ago

thx!!!!!