Comments (3)
Hello,
It seems that you have matched the wrong weight names.
C3 layer in the official repo (link) is the same as CSPDarknetStage layer in my implementation (link). cv3 corresponds to out_conv, not conv1.
The correct mapping would be
- conv -> separate conv layer
- conv1 -> cv2
- conv2 -> cv1
- blocks -> m
- out_conv -> cv3
Maybe I can write a script to convert the weights since some people have requested it before. I will update it here.
from vision-toolbox.
Hello,
When I implemented YOLOv5, I checked the total number of parameters in my implementation against the official models, and they were the same. So I was quite confident that the implementation is correct.
I think there are two possible scenarios:
- YOLOv5 changes its architecture some time after I implemented mine.
- You match the wrong weight names from my implementation to the official one. The naming and order of the weights can be very different. I recommend you to use Netron to inspect the model architecture to make sure you map the correct weights. You can also dig into the source code.
I will check on the two possible reasons above when I have some time.
Cheers!
from vision-toolbox.
Hello @AlonZolfi,
I have added the script to convert YOLOv5 backbone weights.
python scripts/convert_yolov5_weights.py {weights_from_this_repo.pth} {save_path.pth}
Here are the notes I added to my README
The weights will be renamed to be compatiable with Ultralytics' repo. Note that the converted
.pth
file only contains the renamed state dict, up tomodel.8
(the backbone part, without the SPPF layer). You will need to modify their train script to treat the loaded file as a state dict, instead of a dictionary with keymodel
containing the model object.
I haven't tested training a full YOLOv5 object detector with the converted weights, so this function is not guaranteed to work correctly.
I'm not familiar with the YOLOv5 codebase. You can help me test if the converted weights work correctly with the official YOLOv5 repo.
Cheers!
from vision-toolbox.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vision-toolbox.