chaosmail / caffejs

Run Caffe models in the browser using ConvNetJS
https://chaosmail.github.io/caffejs/
MIT License
118 stars 21 forks source link

AlexNet weights corrupt? #3

Closed victoriastuart closed 7 years ago

victoriastuart commented 7 years ago

Hi Christof: could you kindly check your AlexNet weights, and repost? When I fetch and unzip (linux) the weights.zip file, it reports an error (unspecified).

When I run AlexNet,

function loadModel() {

    model = new Net.CaffeModel(
        //GoogLeNet:
        //'models/bvlc_googlenet/deploy.prototxt',
        //'models/bvlc_googlenet/weights/'
        //AlexNet:
        'models/bvlc_alexnet/deploy.prototxt',
        'models/bvlc_alexnet/weights/'
    );

I get the same classifications, regardless of the webcam capture:

indigo bunting, indigo finch, indigo bird, Passerina cyanea
tench, Tinca tinca
mountain bike, all-terrain bike, off-roader
mixing bowl
mobile home, manufactured home

Thanks, appreciated!


[victoria@victoria weights]$ unzip -K weights.zip

Archive:  weights.zip
warning:  stripped absolute path spec from /
mapname:  conversion of  failed

  inflating: fc8_filter.bin
  inflating: fc7_bias.bin
  inflating: conv2_filter.bin
  inflating: conv5_filter.bin
  inflating: conv1_filter.bin
  inflating: conv2_bias.bin
  inflating: conv4_bias.bin
  inflating: fc7_filter.bin
  inflating: conv5_bias.bin
  inflating: conv3_bias.bin
  inflating: conv1_bias.bin
  inflating: conv3_filter.bin
  inflating: fc8_bias.bin
  inflating: conv4_filter.bin
  inflating: fc6_bias.bin
  inflating: fc6_filter.bin

[victoria@victoria weights]$ l

total 449M
-rwxr--r-- 1 victoria victoria  384 Jul 15 16:59 conv1_bias.bin
-rwxr--r-- 1 victoria victoria 137K Jul 15 16:59 conv1_filter.bin
-rwxr--r-- 1 victoria victoria 1.0K Jul 15 16:59 conv2_bias.bin
-rwxr--r-- 1 victoria victoria 1.2M Jul 15 16:59 conv2_filter.bin
-rwxr--r-- 1 victoria victoria 1.5K Jul 15 16:59 conv3_bias.bin
-rwxr--r-- 1 victoria victoria 3.4M Jul 15 16:59 conv3_filter.bin
-rwxr--r-- 1 victoria victoria 1.5K Jul 15 16:59 conv4_bias.bin
-rwxr--r-- 1 victoria victoria 2.6M Jul 15 16:59 conv4_filter.bin
-rwxr--r-- 1 victoria victoria 1.0K Jul 15 16:59 conv5_bias.bin
-rwxr--r-- 1 victoria victoria 1.7M Jul 15 16:59 conv5_filter.bin
-rwxr--r-- 1 victoria victoria  16K Jul 15 16:59 fc6_bias.bin
-rwxr--r-- 1 victoria victoria 144M Jul 15 16:59 fc6_filter.bin
-rwxr--r-- 1 victoria victoria  16K Jul 15 16:59 fc7_bias.bin
-rwxr--r-- 1 victoria victoria  64M Jul 15 16:59 fc7_filter.bin
-rwxr--r-- 1 victoria victoria 4.0K Jul 15 16:59 fc8_bias.bin
-rwxr--r-- 1 victoria victoria  16M Jul 15 16:59 fc8_filter.bin
-rw-r--r-- 1 victoria victoria 217M Jan  3 14:24 weights.zip

[victoria@victoria weights]$

MayuraRam commented 7 years ago

I got similar errors and created the weights files myself. I get the same inference result - as follows with any image.

indigo bunting, indigo finch, indigo bird, Passerina cyanea cliff dwelling great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias tiger shark, Galeocerdo cuvieri hammerhead, hammerhead shark

chaosmail commented 7 years ago

I tried to debug this issue, and it seems that the softmax layer implementation used in CaffeJS (from ConvNetJS) is not yielding the same results as the one implemented in Caffe (where the model was trained).

MayuraRam commented 7 years ago

Thank you. CaffeJS looks good - looking forward to the future versions!

chaosmail commented 7 years ago

Thanks for the feedback @CACUser! CaffeJS started out of a proof of concept; I hope I will have more time to push it further in the following months. If you like the idea, you should also take a look at https://github.com/transcranial/keras-js which looks also very promising (and more active). Best, Christoph