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: