-
Notifications
You must be signed in to change notification settings - Fork 1k
Releasing Other Models? #11
Comments
WoW....... |
Why did they only release the ResNet model and not the Googlenet model? |
It works in TensorFlow converted with this tool. |
No, the tool cannot convert it, exits with ValueError. |
I used pycaffe to run the model successfully. However, used the cv::dnn (DNN module of opencv for loading caffe model) was failed. Is it because of the ResNet structure? |
@zzzcpan install pycaffe first, ValueError is gone afterwards. |
The Scale layer in Caffe is implemented in Batch Normalization layer in Torch. BN layer in Torch nn library has four parameters: weight, bias, running_mean and running_var, the weight and bias here are the factor and bias in Caffe Scale layer. So you could convert this model to Torch. Probably other platforms as well. If you plan to convert this from Caffe to Torch, here are two things you might want to know: In Caffe BN layer, there's a scale factor stored in eg. nsfw_net.params['bn_1'][2].data. You need to divide this factor from all mean and var before you copy these parameters to Torch BN layer. The pooling layer default setting in Torch is different to Caffe. Mainly about padding, when the padding is not set up, the default value is 0 in both Torch and Caffe, but if the ( inputSize - kernelSize + 2 * padding) / stride is not an integer, in Torch the default setting is floor()(means no padding) while in Caffe it's ceil()(add one side padding each rather than two). A simple way to replicate this layer in Torch is nn.SpatialMaxPooling(kernelSize, kernelSize, stride, stride):ceil() Hope this is helpful. |
I know I'm a bit late, but I've managed to convert the model to tensorflow ;) Hope it's useful for the one's having problems with the conversion process. Check out the code and documentation at tensorflow-open_nsfw if you're interested. |
@mdietrichstein Using this Tensorflowcode here: https://github.com/ProGamerGov/Protobuf-Dreamer, I was able to find DeepDream layer and channel combinations which produced hallucinations entirely comprised of specific categories: https://github.com/ProGamerGov/Protobuf-Dreamer/wiki/Interesting-Layers-And-Channels It would be interesting to use the DeepDream "layer + channel" technique to see what exactly each category of the I have previously experimented using the open_nsfw model and DeepDream without specifying specific channels, and found the results to create vague hallucinations of which the content was difficult to discern: |
@logic1988 I'm not sure what version of OpenCV you used but I'm using this model successfully with OpenCV DNN 3.3.1. You can see the use here. |
First of all, thanks for the release! Second: its a pity that the released model (Resnet) has a highly non-standard layer ("Scale", which has a learnable bias parameter). That means that this model cannot be converted to other frameworks (Torch, MXNet, etc).
Would it be possible to release one of your other models as well, such as the Googlenet model?
Thanks!
The text was updated successfully, but these errors were encountered: