Skip to content

Commit

Permalink
Issue #503 Fix (#544)
Browse files Browse the repository at this point in the history
* Issue #503 Fix

This fixes the issue where the "ModuleNotFoundError: No module named 'keras.layers.normalization'" issue when using TF 2.13.

I tested it with TF 2.12 and nothing seemed to break.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

* Fixed BatchNormalization position for pre-commit

* Update whats_new.rst

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
brianjohannes and pre-commit-ci[bot] authored Feb 6, 2024
1 parent 2ca20aa commit 10303af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/source/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Bugs

- Fix TRCA implementation for different stimulation freqs and for signal filtering (:gh:522 by `Sylvain Chevallier`_)
- Fix saving to BIDS runs with a description string in their name (:gh:`530` by `Pierre Guetschel`_)
- Fix import of keras BatchNormalization for TF 2.13 and higher (:gh:`544` by `Brian Irvine`_)

API changes
~~~~~~~~~~~
Expand Down Expand Up @@ -418,3 +419,4 @@ API changes
.. _Ludovic Darmet: https://github.com/ludovicdmt
.. _Thomas Moreau: https://github.com/tommoral
.. _Jordy Thielen: https://github.com/thijor
.. _Brian Irvine: https://github.com/brianjohannes
2 changes: 1 addition & 1 deletion moabb/pipelines/deep_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Add,
AveragePooling2D,
AvgPool2D,
BatchNormalization,
Concatenate,
Conv2D,
Dense,
Expand All @@ -29,7 +30,6 @@
MaxPooling2D,
Permute,
)
from keras.layers.normalization.batch_normalization import BatchNormalization
from keras.models import Model, Sequential
from scikeras.wrappers import KerasClassifier

Expand Down
2 changes: 1 addition & 1 deletion moabb/pipelines/utils_deep_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
Activation,
Add,
AveragePooling2D,
BatchNormalization,
Conv1D,
Conv2D,
DepthwiseConv2D,
Dropout,
SeparableConv2D,
)
from keras.layers.normalization.batch_normalization import BatchNormalization


def EEGNet(
Expand Down

0 comments on commit 10303af

Please sign in to comment.