johnolafenwa / DeepStack

The World's Leading Cross Platform AI Engine for Edge Devices
Apache License 2.0
675 stars 105 forks source link

[Feature Req] Update to support latest implementation of YOLOv5 #87

Open MaleNurse opened 3 years ago

MaleNurse commented 3 years ago

When attempting to use custom models trained w/ stock YOLOv5 as opposed to deepstack-trainer, the error Can't get attribute 'C3' on <module 'models.common' while loading XXXX is reported in the logs. According to the developer here, it means that the detection code is out of sync with the official repo. It would be great to be able use models genereated from more recent code, and I realize that probably means updating python and torch, but all are good things in my opinion.

Thanks for you work

johnolafenwa commented 3 years ago

Hello @MaleNurse , thank you for reporting this. The reason we have the DeepStack trainer is to be independent of the official yolov5 codebase and breaking changes that might be made to it. Are there particular reasons why you need to use the stock YOLOV5 ?

MaleNurse commented 3 years ago

@johnolafenwa The desire for stability is certainly a good point, and I don't mean to say that your code needs to run lock-step with his. Those of us that are willing to take chances could play in Ultralytics' repo and if something becomes unstable we can always walk back to a commit that we know worked in the past, while others that simply wish to open the supplied Colab notebook and go with it are free to do so.

As to why I would like to be able to see compatibility, besides possible gains in efficiency and accuracy with v4.0 of YOLOv5, there is the native integration of WandB to be able to easily compare metric between training configs. Another would be the ability to easily use image annotation/augmentation services such as RoboFlow without having to change the exported dataset.

But anyways, like the title said, it's a feature request. Regardless of the outcome, I'm still very appreciative of your work on this and intend on using it as long as you're willing to maintain it.

MaleNurse commented 3 years ago

So just an update to me playing around: I was able to get deepstack to accept models utilizing stock training. All it really took was updating torch to 1.7.1 and torchvision to 0.8.2 in the docker image, then training with a model that has a modified YAML substituting C3 (which Ultralytics implemented w/ v4) with BottleneckCSP which is still supported in his code. I've also added training with the v3.1 checkpoints which I have saved to my Google Drive and then outputting training runs to that drive so I don't lose them after an idle disconnect (happened one too many times before paying for pro). So far it's been working great. It's messy (I'm less than a novice coder, and this is my first foray into python) but this is the notebook I'm using. Once again, thanks for your work.