When using pytorch to load the pre training model, an error occurs: modulenotfounderror: no module named ‘models’. The pre training model is yolov5s.pt downloaded from the official
Build the directory structure of yolov5 under the wrong file directory. That is, you need to exist yolov5 models and utils, and copy these two folders to the file directory. For example, at this time, the location where I report an error is yolov5/train.py. Because I use yolov5 for transplantation, the yolov5 directory is not a real yolov5, so I will report missing models. The deeper reason is that the following method is used to save weights (there is another way to save and load models, which can be viewed in the official document of pytorch. That method will not cause this problem and is more conducive to migration):
The weights saved in this way will also save the relative position of the source code of your model by default (here refers to the models folder and utils folder in yolov5).Yolo5s.pt downloaded from the official must be trained under this directory structure, so we can build this directory structure.
- Detailed explanation of yolo2 — yolo9000, better, faster, stronger
- [Solved] module ‘keras.engine.topology’ has no attribute ‘load_weights_from_hdf5_group_by_name…
- Name Error: name ‘yolo_head’ is not defined [How to Solve]
- What are hyperparameters in machine learning?
- python Warning: OverflowError: Python int too large to convert to C long
- Preservation and recovery of TF. Train. Saver () model of tensorflow
- [How to Solve Pytorch Error] EOFError: Ran out of input
- [Solved] Keras loads the model Error: attributeerror: ‘STR’ object has no attribute ‘decode’
- Django: How to Convert Models object to JSON
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘M…