-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
Change imports to include tf.keras #83
Conversation
To be clear, these changes won't error out if either keras or tensorflow (or both) are not installed. It will print out and tell you, though. |
Ok going to have a look :) |
Just for info, with the current master, tensorflow 2.0 + latest keras works:
When you say tensorflow 2.0, you mean without installing Keras right? |
And this would not work? https://github.com/philipperemy/keras-tcn/pull/74/files |
Well, with the try-catch, doesn't it make it almost impossible to use pure keras with a different backend if you have tensor flow installed? That was the only reason I did it like this. Also, I seem to have a weird issue now with the imports using importlib, so maybe a simple try catch there is better. |
Yeah I'd be in favor of a simpler solution like a very trivial try catch. |
But still set up the way I did it? Or like #74? |
I still feel like the try catch solution is more elegant. |
I agree, but should the try catch be in init.py and have submodules as I did it, or should we just make sure #74 works well and use that? |
I don't have a clear opinion on it. What would be the most pythonic solution in your opinion? |
:D well, to be honest I‘m still pretty new to python, so I wouldn‘t trust my thoughts on pythonic. If people use this with other backends AND have tensorflow installed, then #74 wouldn‘t work for them. That‘s the only reason I proposed this. I‘d be open to calling in a more experienced pythoner for their opinion because I am truly curious if what I‘ve done is a good idea. Know anyone? :) |
I'd say the simple with the try catch is probably the best at the moment. I'm not a big fan of dynamic imports in python :) |
See #94 |
This is a proposed solution to getting rid of the tensor flow 2.0 branch. It may not be the most intuitive, but it works nicely and there is only one TCN class that is common between the two imports.
Now works with
from tcn.keras import TCN, compiled_tcn
and/or
from tcn.tensorflow import TCN, compiled_tcn