view报错:
outputs_cls = outputs_cls.view(tmp_batch*tmp_channel, -1)
ValueError: Type must be a sub-type of ndarray type
github上有这样一段话,
意思是numpy的数组array和torch中的tensor二者的view不一样,numpy的数组会改变数据的类型,所以如果想要改变array的shape,需要使用reshape, 解决方法就是将代码中的view改为reshape即可。