thuml/Transfer-Learning-Library

np.float aliase is removed in newer versions of Numpy

NightXBurn opened this issue · 1 comments

Describe the bug
From the 1.24 Numpy version 1.24, aliases for float, int and similar dtypes are removed.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repo
  2. Check if you have a 1.24>= numpy version or update your numpy version
  3. Run the example of the dann.py for image classification
  4. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.

Expected behavior
Expect the model to work correctly.

Desktop (please complete the following information):

  • OS: osx
  • Browser chrome

Solution
Replace all np.float, np.int, ... with float, int, dtypes.

Thanks for pointing this out. Indeed, the recommended PyTorch version of our library is somewhat old. We will consider update this later.