Open urinieto opened 7 years ago
yeah, seya is based on keras 0.3 but a few layers were adapted in the branch called keras1. STN is one of them, try that one for latest versions of keras
Thanks for your reply, I will try out the keras1 branch.
I fixed the build function issue by updating the attention.py
file to the keras1 version: https://github.com/EderSantana/seya/blob/keras1/seya/layers/attention.py
But now I have this issue, any ideas what the fan_in
and fan_out
are used for?
File "/home/gabi/PycharmProjects/fish/fish_detection/spatial_trafo/mnist.py", line 91, in
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 324, in add output_tensor = layer(self.outputs[0])
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 491, in call self.build(input_shapes[0])
File "/usr/local/lib/python2.7/dist-packages/keras/layers/convolutional.py", line 409, in build self.W = self.init(self.W_shape, name='{}_W'.format(self.name))
File "/usr/local/lib/python2.7/dist-packages/keras/initializations.py", line 59, in glorot_uniform s = np.sqrt(6. / (fan_in + fan_out))
ZeroDivisionError: float division by zero
that error is weird. fan_in and fan_out are the sizes of input and output layers. and I'm sure you didn't declare a layer with zero connections...
Yeah. I couldn't figure it out. I'm just running it with keras 0.3.3 now and no issues.
I couldn't get the SpatialTransformer to work in my normal environment. So I set up a virtualnev with Keras 0.3.3 and installed Seya to that.
Trying to run the ST example ipynb for cluttered mnist, but I'm getting a problem. The net is learning nothing, loss stays exactly the same.
@9thDimension @redsphinx @urinieto here https://github.com/oarriaga/spatial_transformer_networks I have a working ipython notebook with the very same example using keras 1.1.1 with tensorflow 0.12.0 as backend.
@EderSantana if you want, I can make a pull request with the tensorflow implementation, just tell me where should I put the file containing the layer.
Hi @oarriaga thanks for all the help! I think you can write the it all to the attention.py file. Check if the user uses Theano or TF and use the appropriate code. Have other ideas?
Also, if your code is keras1 compatible make sure you PR to that branch.
Great, thanks!
On Thu, Feb 16, 2017 at 8:20 PM, Eder Santana notifications@github.com wrote:
Hi @oarriaga https://github.com/oarriaga thanks for all the help! I think you can write the it all to the attention.py file. Check if the user uses Theano or TF and use the appropriate code. Have other ideas?
Also, if your code is keras1 compatible make sure you PR to that branch.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/EderSantana/seya/issues/48#issuecomment-280547453, or mute the thread https://github.com/notifications/unsubscribe-auth/ADhisdsFCul84TwOCRvwZ6C_WwmXz1qqks5rdSALgaJpZM4K5uRH .
Hi everyone, I got the MNIST example running with the help of @oarriaga Notebook. I tried to load a custom image directory/dataset from disk for running Spatial Transformation, but got stuck with an issue.
Specifically after some amount of inspecting the code, there seems to be some issue with the datatype of the numpy image array. When the images are - uint8 - image display working fine , training not working(images are displayed blank during training) (Loss is becoming zero with blank images displayed). Similair to @9thDimension Comment before
float32 - image getting deformed(pixellated, random noise). But training seems to be working with noisy images. The noisy image looks like this
Any idea how to fix this? Thanks!
It seems like the keras'
build
function of the layers has changed its prototype and it now takes theinput_shape
as parameter, so this fails (see keras documentation).Regardless, once I fix this, I get an error once the SpatialTransform layer tries to set the
self.input
attribute fromlocnet
's input. This is what I get when I try to run the example:Any idea how to fix this? Thanks!
UPDATE: I'm on keras 1.1.1, using Python 3.5.2 on Anaconda 4.2.0 UPDATE 2: After trying with several keras versions, it seems like the jupyter example only works with keras 0.3.2