oarriaga / STN.keras

Implementation of spatial transformer networks (STNs) in keras 2 with tensorflow as backend.
MIT License
278 stars 75 forks source link

Support keras 2.1.6 and tensorflow 1.8.0 #8

Closed chensong1995 closed 6 years ago

chensong1995 commented 6 years ago

In keras 2.1.6, the existing code gives an error 'Sequential' object has no attribute 'constraints'. An issue has been created to address this issue.

It seems to me that the current version of keras no longer uses this member variable and the issue can be solved by simply removing the line self.constraints = self.locnet.constraints. I trained a usable spatial transformer network to verify the fix works.

Meanwhile, in the example file, I also updated Convolution2D layers to Conv2D layers to match the new keras interface.

oarriaga commented 6 years ago

Thank you ;)