title: Error importing binary_weighted_focal_crossentropy from keras backend: Cannot import name
body: <pre><code>---------------------------------------------------------------------------
  ImportError                               Traceback (most recent call last)
  Input In [20], in &lt;cell line: 1&gt;()
  ----&gt; 1 from tensorflow.keras import layers
        2 import keras.backend as backend
        3 import tensorflow as tf
  
  File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\api\_v2\keras\__init__.py:13, in &lt;module&gt;
       10 import sys as _sys
       12 from keras import __version__
  ---&gt; 13 from keras.api._v2.keras import __internal__
       14 from keras.api._v2.keras import activations
       15 from keras.api._v2.keras import applications
  
  File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\api\__init__.py:8, in &lt;module&gt;
        3 &quot;&quot;&quot;Public API for tf. namespace.
        4 &quot;&quot;&quot;
        6 import sys as _sys
  ----&gt; 8 from keras.api import keras
        9 from tensorflow.python.util import module_wrapper as _module_wrapper
       11 if not isinstance(_sys.modules[__name__], _module_wrapper.TFModuleWrapper):
  
  File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\api\keras\__init__.py:16, in &lt;module&gt;
       14 from keras.api.keras import activations
       15 from keras.api.keras import applications
  ---&gt; 16 from keras.api.keras import backend
       17 from keras.api.keras import callbacks
       18 from keras.api.keras import constraints
  
  File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\api\keras\backend\__init__.py:24, in &lt;module&gt;
       22 from keras.backend import binary_crossentropy
       23 from keras.backend import binary_focal_crossentropy
  ---&gt; 24 from keras.backend import binary_weighted_focal_crossentropy
       25 from keras.backend import cast
       26 from keras.backend import cast_to_floatx
  
  ImportError: cannot import name 'binary_weighted_focal_crossentropy' from 'keras.backend' (D:\Users\DGong\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\backend.py)
  </code></pre>
  <p>I can't figure out why I'm getting an import error here. I've uninstalled and reinstalled <code>tensorflow</code> and <code>keras</code> many times, as well as used both pip and pip3. I checked the file and nothing seems to be different between the way <code>binary_focal_crossentropy</code> and <code>binary_weighted_focal_crossentropy</code> is exported. But the former seems to import without error.</p>