-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem using different channels #4
Comments
The different channels are just supposed to be the same transform for e.g. each color, right? In that case, tfwavelets does not support that (because of how the transform is implemented, to increase GPU parallelism we implemented a 2D transform as 1D with batching, so the channel dimension is already in use). To use channels, you sadly have to split the image into separate 1-channeled images and apply the transform separately to each channel, and stack them after. |
Thank you for your answer. After some modifications of your programs, I was finally able to apply the 2D transform to images with different channels =) I am not sure this implementation is optimal, but it does work. If you are interested in those modifications, please let me know. |
I'm interest in how to support multi-channel, if it is convenient, can you show me the modefication? Thanks~ |
I didn't find the way to upload directly the scripts... So here are all the (partially modified) functions that make the multi-channel computations possible. You can replace all the functions in the original scripts by the following ones:
|
Hello! =)
I may have missed something, but I guess that if I want to apply your tfw.dwt2d to an image with different channels, I should be able to write something like:
size_image = 64
nb_channels = 4
tf_signal = tf.placeholder(dtype=tf.float32, shape=(size_image,size_image,nb_channels))
output = tfw.dwt2d(tf_signal, wavelet=dwtcoeffs.haar, levels=3)
But then, I get the following error:
Dimensions must be equal, but are 4 and 1 for 'conv1d_34/Conv2D' (op: 'Conv2D') with input shapes: [64,1,64,4], [1,2,1,1].
Actually, the dimensions of the filters are wrong... While there is no problem when nb_channels = 1.
Would you know how to fix this please?
Thank you very much!
Mathilde
The text was updated successfully, but these errors were encountered: