0

I tried importing the following code:

import tensorflow as tf
from tensorflow.python.ops.numpy_ops import np_config

I got the following error:

ImportError: cannot import name 'np_config' from 'tensorflow.python.ops.numpy_ops' (C:\Anaconda3\lib\site-packages\tensorflow\python\ops\numpy_ops\__init__.py)

I checked versions of tensorflow and keras:

import tensorflow
print(tf.__version__)
import keras
print(keras.__version__)

Output:

2.4.0
2.4.0

Edit: I followed this link but still not working.

3
  • 2
    Why do you want to import this from private API? It was introduced in TF 2.5 Commented Mar 14, 2023 at 0:56
  • @Frightera. Solved it. Thanks. What is the keras version compatible with tensorflow 2.5 please? Commented Mar 14, 2023 at 1:12
  • 1
    Hi @Avv, For tensorflow 2.5.0 you can use keras 2.5.0 version. If you install tensorflow using pip the compatible version of keras will be automatically downloaded. Thank You. Commented Mar 30, 2023 at 15:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.