KoBERT 모델을 이용하다가 초기에 필요 패키지를 설치하고, 각종 모듈들을 임포트 해주다가 아래와 같은 에러가 발생했다.
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import gluonnlp as nlp
import numpy as np
from tqdm import tqdm, tqdm_notebook
/usr/local/lib/python3.10/dist-packages/mxnet/numpy/utils.py:37: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. bool = onp.bool
5 from torch.utils.data import Dataset, DataLoader
----> 6 import gluonnlp as nlp
7 import numpy as np
8 import pandas as pd
10 frames /usr/local/lib/python3.10/dist-packages/numpy/__init__.py in __getattr__(attr)
317
318 if attr in __former_attrs__: --> 319 raise AttributeError(__former_attrs__[attr])
320
321 if attr == 'testing':
AttributeError: module 'numpy' has no attribute 'bool'. `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. 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