You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
voidsave_weights_upto(network net, char *filename, int cutoff)
{
#ifdef GPU
if(net.gpu_index >= 0){
cuda_set_device(net.gpu_index);
}
#endiffprintf(stderr, "Saving weights to %s\n", filename);
FILE *fp = fopen(filename, "wb");
if(!fp) file_error(filename);
int major = 0;
int minor = 1;
int revision = 0;
fwrite(&major, sizeof(int), 1, fp);
fwrite(&minor, sizeof(int), 1, fp);
fwrite(&revision, sizeof(int), 1, fp);
fwrite(net.seen, sizeof(int), 1, fp);
--------------------
}
Additional Question:
If you know any way to convert the tensorflow, pytorch, keras model to write as a .weights file, please share the method here. I found the links to convert the model in the other way around. (.weights --> .pb/.h5 model)
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.
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
The text was updated successfully, but these errors were encountered: