WePCf / darknet-mobilenet-v2

Darknet for MobileNet v2
Other
80 stars 27 forks source link

The results from Pytorch converted to Darknet are incorrect #5

Open Yuyiqi1992 opened 6 years ago

Yuyiqi1992 commented 6 years ago
    I trained a binary classifier on Pytorch with MobileNetV2, and converted to Darknet and found that the results were very different. Comparing the convolution results of each layer, find that the difference ( about 0.001 at first ) is increasing. In addition, the calculation results between GPU and CPU are also quite different.
    Do you have encountered such problems in the process of converting?
WePCf commented 6 years ago

First, the low-level implementation of pytorch and darknet must be quite different therefore the difference is reasonable.

As for darknet, it is common that results based on cpu and gpu are not identical. But deviation like top-1 accuracy will not be very large.

Please pay attention to imagenet.labels.list referred by imagenet1k.data, the content may be not the same as you think in pytorch.