1

This was the error raised

np.object was a deprecated alias for the builtin object. To avoid this error in existing code, use object by itself. Doing this will not modify any behavior and is safe. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

My tensorflow is version 2.6.0 and Numpy version 1.25.0

Nothing has worked so far, it seems like I was just juggling between pip install of different versions and it seems to open a can of worms and asking me to change different versions of packages I have.

What I have done

  1. I have tried !pip install to upgrade downgrade to solve compatibility issue but no dice
  2. I have tried upgrading the tensorflow packages through Anaconda Navigator but it seems to have bug and just stuck at version 2.6.0

1 Answer 1

1

I'm also using Tensorflow 2.6.0 and numpy 1.25.0 and ran into the same problem. Since I already fixed it, I can't get screenshots of the errors anymore. I also referred to that linked documentation, so we're on exactly the same page. I'm confident this will help you.

Note: my Anaconda environment is named "tf_gpu"

The first error that np.int was deprecated appeared in

anaconda3\envs\tf_gpu\Lib\site-packages\tensorflow\python\framework\dtypes.py

Using the release notes, I went into that file and replaced all instances with np.int_. I don't understand the difference nor why tensorflow hasn't incorporated that yet.

The second error that np.bool was deprecated appeared in the same file. I once again replaced all np.bool with np.bool_ per the numpy 1.25.0 release notes.

The third error popped up in the following folder:

anaconda3\envs\tf_gpu\Lib\site-packages\tensorflow\python\ops

Since I already fixed it, I don't remember which file within this folder the error happened, but the solution was the same as before: replace np.bool with np.bool_.

After those changes, I didn't have any other issues.

Sign up to request clarification or add additional context in comments.

Comments

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.