thuml / Transfer-Learning-Library

Transfer Learning Library for Domain Adaptation, Task Adaptation, and Domain Generalization
http://transfer.thuml.ai
MIT License
3.39k stars 553 forks source link

np.float aliase is removed in newer versions of Numpy #226

Closed NightXBurn closed 10 months ago

NightXBurn commented 1 year ago

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):

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

thucbx99 commented 1 year ago

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