本来我的返回值是这样

 rmac_regions = get_rmac_region_coordinates(features.size()[2],

                                                       features.size()[3], args.rmac_levels).astype(np.int)

问题如下:

 DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.

Deprecated in NumPy 1.20; for more details and guidance: NumPy 1.20.0 Release Notes — NumPy v1.23.dev0 Manual

return np.array(df).astype(np.float)

从图片上看的话

修改为下即可:

 rmac_regions = get_rmac_region_coordinates(features.size()[2],

                                                       features.size()[3], args.rmac_levels).astype(np.int32)

或者

 rmac_regions = get_rmac_region_coordinates(features.size()[2],

                                                       features.size()[3], args.rmac_levels).astype(np.int64)

这样就不会报错了~

参考网址

  1.  https://blog.csdn.net/weixin_44790486/article/details/120633794

  2. https://www.cnblogs.com/stupidwf/p/15353918.html

  3. https://blog.csdn.net/weixin_44790486/article/details/120633794

  4. https://blog.csdn.net/weixin_44333889/article/details/118297897

  5. https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐