Skip to content
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

BUG: allow to import keras from tensorflow #532

Merged
merged 7 commits into from
Jun 12, 2019

Conversation

glemaitre
Copy link
Member

closes #526

@codecov
Copy link

codecov bot commented Jan 19, 2019

Codecov Report

Merging #532 into master will decrease coverage by 0.09%.
The diff coverage is 78.26%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #532     +/-   ##
=========================================
- Coverage   98.93%   98.83%   -0.1%     
=========================================
  Files          85       85             
  Lines        5329     5343     +14     
=========================================
+ Hits         5272     5281      +9     
- Misses         57       62      +5
Impacted Files Coverage Δ
imblearn/keras/_generator.py 91.54% <78.26%> (-6.7%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0aa81c...cb4008b. Read the comment docs.

@glemaitre
Copy link
Member Author

@chkoar The problem is not straightforward here.

Keras did not add the duck-typing on the Sequence for a long time. So we can get an error if we don't import Keras from the package used by the user (Keras or Tensorflow). I don't really have the solution there I think.

I thought about a hack that could use globals() to check if Keras has been imported and use the same package. However, this is pretty brittle. Do you have any idea?

@chkoar chkoar changed the title BUG: allow to import keras from tensorflow [WIP] BUG: allow to import keras from tensorflow Jun 12, 2019
@glemaitre glemaitre changed the title [WIP] BUG: allow to import keras from tensorflow BUG: allow to import keras from tensorflow Jun 12, 2019
@glemaitre glemaitre merged commit 2fa0596 into scikit-learn-contrib:master Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keras batch generator is not able to import keras from tensorflow in windows 10
1 participant