visualizing-and-understanding-convolutional-neural-networks's People
Forkers
lalapo wangsenhong humaolin xuefeicao yaohuaxin dungbachviet forest0812 martbox3721 cj401-jw raman1121 shxy0 modestyao qbxl400 westream tzhalin booooooooooo doll6777 dangxusheng phcwj chelseajohn sebenelet flohofstetter lingjiebao1998 magenasi shadmwanzia 1371131436 akamil-etsy souheiln pkulihongyu xwyangjshbvisualizing-and-understanding-convolutional-neural-networks's Issues
Change the units parameter of Dense in self.down_func to integer instead of tuple
Hi @saketd403 ,
Thank you for your wonderful work :)) However, there is a minor error in the class DDense
(Feature+visualization+using+Deconvnets+in+Keras.ipynb) that I think you should fix.
Specifically,
output = keras.layers.Dense(self.input_shape[1:],
kernel_initializer=tf.constant_initializer(W), bias_initializer=tf.constant_initializer(b))(input)
should be changed to
output = keras.layers.Dense(self.input_shape[1],
kernel_initializer=tf.constant_initializer(W), bias_initializer=tf.constant_initializer(b))(input)
in the definition of self.down_func
.
Vinh
No file 'C:\Users\USER\Desktop\inverting convolutional layers\Max pooling\model.pkl'
Give credit to owner's repo
Hi @saketd403 ,
Thank you so much for your wonderful work. I tried days to find an actual implementation of DeconvNN, and yours solved my problem.
However, during my searching, I found that yours may be adapted from the repo of jalused. Though his work is not compatible with the current Keras version, the coding style is quite similar.
I suggest you add a comment to give him a credit if that's the case :)
Vinh
deconv = visualize(model, img_array, layer_name, feature_to_visualize, visualize_mode)
when exec
deconv = visualize(model, img_array, layer_name, feature_to_visualize, visualize_mode)
There is an InvalidArgumentError
`InvalidArgumentError Traceback (most recent call last)
in
1 deconv = visualize(model, img_array,
----> 2 layer_name, feature_to_visualize, visualize_mode)
in visualize(model, data, layer_name, feature_to_visualize, visualize_mode)
29 deconv_layers[0].up(data)
30 for i in range(1, len(deconv_layers)):
---> 31 deconv_layers[i].up(deconv_layers[i - 1].up_data)
32
33 output = deconv_layers[-1].up_data
in up(self, data, learning_phase)
34 def up(self, data, learning_phase = 0):
35 #Forward pass
---> 36 self.up_data = self.up_func([data, learning_phase])
37 self.up_data=np.squeeze(self.up_data,axis=0)
38 self.up_data=numpy.expand_dims(self.up_data,axis=0)
~/anaconda3/envs/tfEnv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in call(self, inputs)
2713 return self._legacy_call(inputs)
2714
-> 2715 return self._call(inputs)
2716 else:
2717 if py_any(is_tensor(x) for x in inputs):
~/anaconda3/envs/tfEnv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in _call(self, inputs)
2673 fetched = self._callable_fn(*array_vals, run_metadata=self.run_metadata)
2674 else:
-> 2675 fetched = self._callable_fn(*array_vals)
2676 return fetched[:len(self.outputs)]
2677
~/anaconda3/envs/tfEnv/lib/python3.6/site-packages/tensorflow/python/client/session.py in call(self, *args, **kwargs)
1380 ret = tf_session.TF_SessionRunCallable(
1381 self._session._session, self._handle, args, status,
-> 1382 run_metadata_ptr)
1383 if run_metadata:
1384 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
~/anaconda3/envs/tfEnv/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py in exit(self, type_arg, value_arg, traceback_arg)
517 None, None,
518 compat.as_text(c_api.TF_Message(self.status.status)),
--> 519 c_api.TF_GetCode(self.status.status))
520 # Delete the underlying status object from memory otherwise it stays alive
521 # as there is a reference to status from this from the traceback due to
InvalidArgumentError: transpose expects a vector of size 6. But input(1) is a vector of size 4
[[Node: conv2d_84/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer = Transpose[T=DT_FLOAT, Tperm=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](_arg_input_85_0_0/_1345, PermConstNHWCToNCHW-LayoutOptimizer)]]`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.