Git Product home page Git Product logo

visualizing_understanding_cnn_implementation's People

Contributors

fhainzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

visualizing_understanding_cnn_implementation's Issues

Is there a bug?

deconvolution.py about Line 164

# Set other layers to zero
    new_array = np.zeros_like(self.array)
    new_array[0, self.f - 1] = self.array[0, self.f - 1]

    # Set other activations in same layer to zero
    max_index_flat = np.nanargmax(new_array)
    max_index = np.unravel_index(max_index_flat, new_array.shape)
    self.array = np.zeros_like(new_array)
    self.array[max_index] = new_array[max_index]

There is only one pixel is not zero in the input.

ValueError: No such layer: conv_1

Hello! I've trained a VGG19 model on two classes of images. After importing your entire library and running get_activations(1, model), I get the error ValueError: No such layer: conv_1. I think this means that the base_model passed into get_activations has to also be an AlexNet model. Is that true?

Full stack trace:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-9-7b96cf8b918e> in <module>()
      2 
      3 
----> 4 get_activations(1, model)
      5 start = time.time()
      6 find_strongest_image(1)

~/workingdir/activations.py in get_activations(layer_num, base_model, mode, folder)
     29 
     30     # Create Model up to layer_num
---> 31     model = AlexNet(layer_num, base_model)
     32 
     33     # For timing

~/workingdir/alexnet.py in __init__(self, highest_layer_num, base_model)
    142         self.highest_layer_num = highest_layer_num
    143         self.base_model = base_model if base_model else alexnet_model()  # If no base_model, create alexnet_model
--> 144         self.model = self._sub_model() if highest_layer_num else self.base_model  # Use full network if no highest_layer
    145 
    146     def _sub_model(self):

~/workingdir/alexnet.py in _sub_model(self)
    146     def _sub_model(self):
    147         highest_layer_name = 'conv_{}'.format(self.highest_layer_num)
--> 148         highest_layer = self.base_model.get_layer(highest_layer_name)
    149         return Model(inputs=self.base_model.input,
    150                      outputs=highest_layer.output)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/keras/engine/topology.py in get_layer(self, name, index)
   1889                 return layer
   1890 
-> 1891         raise ValueError('No such layer: ' + name)
   1892 
   1893     @property

ValueError: No such layer: conv_1

ValueError

When I run your code with keras 2.0.8 tensorflow 1.4.1, I get some problem:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 0 in both shapes must be equal, but are 3 and 384 for 'Assign_6' (op: 'Assign') with input shapes: [3,3,128,384], [384,256,3,3]
what's wrong?

Transposed filters

I was wondering if the deconv filters are trainable, or they are just transpose of the (pretrained) conv filters? If the latter, are we assuming the filters are unitary?

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.