Code Monkey home page Code Monkey logo

subpixel's Introduction

SubPixel - A caffe implementation of this

Instructions

- Paste the Layer file in the python folder of caffe
- Follow the instructions inside the test script. (meant to be run inside ipython)
- An example usage prototxt is also given.

Warning

This is my attempt at porting the code in tensorflow to caffe. I might have made mistakes. Please do let me know if any. A test script is also provided to play around. I haven't used it in any training yet. I just finished writing this. Will update on progress

subpixel's People

Contributors

img-prcsng avatar lucylu-lx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

subpixel's Issues

compare the results between caffe and TF

thank you for your contribution. I test the caffemodel of which the weights and bias were converted from tensorflow model. result from each layer was verified as below
caffe(fp32) : h0 h1 h2 ps caffe_output_tanh
Tensorflow(fp32): tf_h0 tf_h1 tf_h2 tf_output_tanh
image

indeed, there are still some different between caffe and TF, but i think it may not cause by python layer. I think the designed ps layer is right!

python3 numpy float int

e:\python22\envs\dream\lib\site-packages\caffe\classifier.py in __init__(self, model_file, pretrained_file, image_dims, mean, input_scale, raw_scale, channel_swap)
     24                  mean=None, input_scale=None, raw_scale=None,
     25                  channel_swap=None):
---> 26         caffe.Net.__init__(self, model_file, pretrained_file, caffe.TEST)
     27 
     28         # configure pre-processing

E:\w\PyPixelShuffleLayer.py in reshape(self, bottom, top)
     67 
     68     def reshape(self, bottom, top):
---> 69         top[0].reshape(self.n, self.out_channels, self.out_h, self.out_w)
     70 
     71 

TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type float

Slower than deconvolution

I try to use the subpixel layer as an efficient way to replace deconvolution layer.
However, the forward speed of subpixel layer (18ms) is way slower than the deconvolution layer(2 ms).
Any idea why this happened?
details:
input blobs: 1x4x540x960
deconvolution: num_output: 1; kernel_size: 2; stride: 2; pad: 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.