AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
时间: 2023-10-26 16:49:27 浏览: 224
【Python】AttributeError: ‘AutoSchema’ object has no attribute ‘get_link’
5星 · 资源好评率100%
This error message indicates that there is an attempt to access the attribute "recompute_scale_factor" on an object of the class "Upsample" which does not have that attribute.
The most likely cause of this error is that the code is written for an older version of PyTorch, where the "Upsample" class had a "recompute_scale_factor" attribute. In newer versions of PyTorch, this attribute has been removed and replaced with other methods and attributes.
To fix this error, you need to update the code to use the correct methods and attributes for the version of PyTorch you are using. This may involve modifying the code to use a different class or method for upsampling, or updating the existing code to use the correct syntax for the new version of PyTorch.
阅读全文