Search code examples
pythontensorflowkeras

ImportError: cannot import name 'ops'


My version is : Python 3.6.8 keras:2.6.0 tensorflow:2.6.0

when I try: from keras import ops

It got this: cannot import name 'ops'

How do I solve this issue? Really appreciate your help.


Solution

  • You trying to use keras 3 command so u need to upgrade your keras.

    pip install --upgrade keras
    

    You will also needed to update your tensorflow to avoid several incompatibilities

    pip install --upgrade tensorflow