Javacr / PyQt5-YOLOv5

PyQt5 implementation of YOLOv5 GUI
GNU General Public License v3.0
1.32k stars 222 forks source link

Upsample' object has no attribute 'recompute scale factor'请问一下这个怎么解决了 #30

Open wujijians opened 1 year ago

kordokrip commented 1 year ago

File path: \Python39\site-packages\torch\nn\modules\upsampling.py

Find the file in the path written above and modify the code as below.

def forward(self, input: Tensor) -> Tensor:

return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,

    #                      recompute_scale_factor=self.recompute_scale_factor)
    return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)
EugeoKirito commented 1 year ago

找到文件upsampling.py并打开 修改

return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,recompute_scale_factor=self.recompute_scale_factor)

为 return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)