关于Numpy更新后旧用法剔除报错问题,Deprecated in NumPy 1.20; for more details and guidance
本来我的返回值是这样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...
本来我的返回值是这样
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)
这样就不会报错了~
参考网址
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)