gmalivenko / pytorch2keras

PyTorch to Keras model convertor
https://pytorch2keras.readthedocs.io/en/latest/
MIT License
858 stars 143 forks source link

Explicit Tensorflow import in lambda layer #66

Closed ElteHupkes closed 5 years ago

ElteHupkes commented 5 years ago

While converting a model that has this layer with change_ordering = True, I got a crash because tf was not defined. Apparently the lambda is executed quite literally without the scope context. To be perfectly honest I have no idea about the specifics there, but this change fixes the crash.

gmalivenko commented 5 years ago

Hello, @ElteHupkes ! Yes, I missed this one, thanks!