Python报错:
ValueError: Type must be a sub-type of ndarray type
错误行:
outputs = outputs.view(tmp_batch*tmp_channel, -1)
修改方法:
numpy的数组array和torch中的tensor二者的view不同,需要使用reshape, 解决方法就是将代码中的view改为reshape即可。
Python报错:
ValueError: Type must be a sub-type of ndarray type
错误行:
outputs = outputs.view(tmp_batch*tmp_channel, -1)
修改方法:
numpy的数组array和torch中的tensor二者的view不同,需要使用reshape, 解决方法就是将代码中的view改为reshape即可。