'AvgPool2d' object has no attribute 'divisor_override'
时间: 2023-08-11 08:08:22 浏览: 168
这个错误通常发生在使用PyTorch的AvgPool2d函数时,该函数没有divisor_override属性。这是因为在较新的版本中,divisor_override属性已被移除。
如果你使用的是旧版本的PyTorch,你可以尝试更新到较新的版本以解决这个问题。如果你无法更新PyTorch版本,你可以考虑使用其他替代函数来实现相同的功能,例如nn.AdaptiveAvgPool2d。
另外,请确保你的代码没有错误地使用了divisor_override属性。你可以检查一下你的代码,看看是否有地方错误地使用了这个属性。
相关问题
AttributeError: 'AvgPool2d' object has no attribute 'divisor_override'
这个错误是由于PyTorch版本更新导致的,旧版本中的AvgPool2d层有一个divisor_override参数,但是在新版本中已经被移除了。如果你的代码中使用了这个参数,需要将其替换为count_include_pad参数。如果你使用的是旧版本的PyTorch,可以尝试升级到新版本来解决这个问题。如果你已经使用了新版本的PyTorch,那么你需要修改代码以适应新版本的API。
'Poly3DCollection' object has no attribute '_facecolors2d'
This error message is typically encountered when using the Poly3DCollection class from the matplotlib library.
The Poly3DCollection object is used to represent a collection of 3D polygons, and is often used in conjunction with the Axes3D class.
The error message suggests that the '_facecolors2d' attribute is missing from the object. This attribute is used to store the colors of the polygon faces in 2D space.
There are several possible reasons why this error message might occur. One possible cause is that the Poly3DCollection object was not properly initialized with the necessary attributes. Another possible cause is that the object was modified in some way that caused the '_facecolors2d' attribute to be deleted or corrupted.
To fix this error, you may need to review your code and ensure that the Poly3DCollection object is properly initialized with all necessary attributes. If the object was modified in some way, you may need to revert the changes or create a new object with the correct settings.
阅读全文