Skip to content

Commit 94dcc8f

Browse files
authored
tensorflow 2.0 not having attribute python
in tensorflow 2.0 replacing "import tensorflow.python.keras.backend" as K with "from tensorflow.python.keras import backend as K" solves the error tensorflow does not have attribute 'python'.
1 parent cab3bbd commit 94dcc8f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

keras_attention_layer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import tensorflow as tf
22
from tensorflow.python import keras
33
from tensorflow.python.keras.layers import Layer
4-
import tensorflow.python.keras.backend as K
4+
from tensorflow.python.keras import backend as K
55
from typing import Optional
66

77

0 commit comments

Comments
 (0)