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
- [Solved] Torch Build Module Error: NotImplementedError
- [ONNXRuntimeError] : 10 : INVALID_Graph loading model error
- [Solved] RuntimeError: function ALSQPlusBackward returned a gradient different than None at position 3, but t
- Pytorch ValueError: Expected more than 1 value per channel when training, got input size [1, 768
- [Solved] Error(s) in loading state_dict for GeneratorResNet
- [Solved] yolov5-6.0 ERROR: AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
- urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>
- “EncoderDecoder: ‘mit_b1 is not in the backbone registry‘“ [How to Solve]
- [Solved] RuntimeError: cublas runtime error : resource allocation failed at
- Python: RNN principle realized by numpy
- RuntimeError: No HIP GPUs are available [How to Solve]
- Python custom convolution kernel weight parameters
- [Solved] RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at
- [Solved] torchsummary Error: RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.F
- [Solved] django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.Did you install mysqlclie
- [Solved] RuntimeError: Error(s) in loading state_dict for Net:
- [Solved] torchvision Error: UserWarning: Failed to load image Python extension: Could not find module
- [Solved] Linux OS python Script Error: smtplib has no attribute SMTP_SSL
- [Solved] Pytorch-geometric Error: No module named torch_sparse