0
点赞
收藏
分享

微信扫一扫

web3 在React dapp中全局管理web3当前登录用户/智能合约等信息

三千筱夜 2023-11-02 阅读 14

这个问题是小虎在初始化自适应平均池化的时候遇到的,解决方法是限制初始化时池化大小的类型。

问题原文

Exception has occurred: TypeError
object of type 'numpy.int64' has no len()
  File "D:\Complier\LEF\lib\model\segmentation\heads\modules\fgModules.py", line 162, in forward
    PoolFeature = callMethod(self, Name)(self.PoolLayer(f))
TypeError: object of type 'numpy.int64' has no len()

解决实例

报错语句如下:

AdaptiveAvgPool2d(self.PoolSize)

查看类型发现是numpy:

type(self.PoolSize)
<class 'numpy.int64'>

所以可以改成:

AdaptiveAvgPool2d(int(self.PoolSize))
举报

相关推荐

0 条评论