Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'numpy' has no attribute 'object'. #130

Open
turgutguvenc opened this issue Jan 8, 2024 · 1 comment
Open

AttributeError: module 'numpy' has no attribute 'object'. #130

turgutguvenc opened this issue Jan 8, 2024 · 1 comment

Comments

@turgutguvenc
Copy link

Information

The problem arises in chapter:

  • [ ***] Text Classification

Describe the bug

When I run this code below I get this error: AttributeError: module 'numpy' has no attribute 'object'. probably map function or dataset library has deprecated version of numpy use use np.object.
emotions_hidden = emotions_encoded.map(extract_hidden_states, batched=True)

To Reproduce

Steps to reproduce the behavior:

  1. I am getting this error when I run this code: emotions_hidden = emotions_encoded.map(extract_hidden_states, batched=True)

AttributeError Traceback (most recent call last)
Cell In[86], line 1
----> 1 emotions_hidden = emotions_encoded.map(extract_hidden_states, batched=True)

AttributeError: module 'numpy' has no attribute 'object'.
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
add Codeadd Markdown

Expected behavior

@PhocaHiro
Copy link

I used "monkey patch" like below.

import numpy as np
np.object = object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants