ry / tensorflow-vgg16

conversation of caffe vgg16 model to tensorflow
672 stars 285 forks source link

inconsistent output from caffe and tf #1

Closed suhangpro closed 8 years ago

suhangpro commented 8 years ago
caffe session
prob shape (1000,)
Top1:  n02123045 tabby, tabby cat
Top5:  ['n02123045 tabby, tabby cat', 'n02124075 Egyptian cat', 'n02123159 tiger cat', 'n02119789 kit fox, Vulpes macrotis', 'n02119022 red fox, Vulpes vulpes']

tensorflow session
Top1:  n02123159 tiger cat
Top5:  ['n02123159 tiger cat', 'n02124075 Egyptian cat', 'n02123045 tabby, tabby cat', 'n02113023 Pembroke, Pembroke Welsh corgi', 'n02094258 Norwich terrier']

Any idea why this happens? Awesome work by the way!

ry commented 8 years ago

Either numerical instability in the softmax layer because np.linalg.norm(caffe2tf_1d_blob('prob') - tf_activations['prob'] is a bit larger than the distance of other layers. And/or from the randomness in the dropout layers

ry commented 8 years ago

fixed in 97a9e1ff663ac7238f986d8b8247f4ab81f83432