Open Sudhakar17 opened 5 years ago
@Sudhakar17 Hi,
I checked the original code in darknet framework, I don't understand the part "cuda_set_device". Is this one impacts the model of the weight to run on GPU?
weights-file can't affect on will be used GPU or not.
If you compiled Darknet with GPU=1 CUDNN=1
in the Makefile, then it will use GPU in any cases.
You can try to convert weights -> pt -> weights by using this way: https://github.com/AlexeyAB/darknet/issues/2914#issuecomment-495905317 and this repository: https://github.com/ultralytics/yolov3
Darknet -> Pytorch: python3 -c "from models import *; convert('cfg/yolov3-spp-sm2-1cls.cfg', '../darknet/backup/yolov3-spp-sm2-1cls_5000.weights')"
Pytroch -> Darknet: python3 -c "from models import *; convert('cfg/yolov3-spp-sm2-1cls.cfg', 'converted.pt')"
https://github.com/talebolano/yolov3-network-slimming Implemented in PyTorch. It uses the yolo-v3 weights from the darknet and retrained the model by following l-1 norm of BN weights. (not important info at the moment)
I am using this code to train the yolo-v3 by sparsity approach. After training the model, it saves the weight into ".weights" file. As we know that in pytorch, the weights can be written in numpy format and save into the file.
My question is that pruned_yolo_v3.weights are not using the GPU to calculate the mAP in the darknet but it works with the CPU and it is dead slow.
I checked the original code in darknet framework, I don't understand the part "cuda_set_device". Is this one impacts the model of the weight to run on GPU?
darknet code
Additional Question:
@AlexeyAB