When running the detect.py program of yolov5, the following error prompt attributeerror appears: can’t get attribute sppf on module models. Common from D:// yolov\ yolov5-5.0\ odels\common.py**
2. Solution
-
- Download yolov6 in GitHub, open the file and find the models folder:
-
- find common.py in the models folder, open it and use the search sppf keyword to find the sppf class in the file, and replace the following code with it:
class SPPF(nn.Module): # export-friendly version of nn.SiLU()
@staticmethod
def forward(x):
return x * torch.sigmoid(x)
Problem-solving:
Read More:
- [Solved] Training yolov5 Error: attributeerror: can get attribute sppf on Module
- AttributeError: can‘t set attribute [How to Solve]
- [Solved] AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘AdampOptimizer‘
- [Solved] AttributeError: module ‘dlib‘ has no attribute ‘get_face_chip‘
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Solved] AttributeError: ‘Manager‘ object has no attribute ‘get_by_natural_key‘
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- from keras.preprocessing.text import Tokenizer error: AttributeError: module ‘tensorflow.compat.v2‘ has..
- AttributeError: module ‘time‘ has no attribute ‘clock‘ [How to Solve]
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [Solved] Python Error: AttributeError: partially initialized module ‘keyword‘ has no attribute ‘kwlist‘
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- [Solved] AttributeError: module ‘PIL.Image‘ has no attribute ‘open‘