Open ys7yoo opened 1 year ago
AttributeError Traceback (most recent call last) Cell In[3], line 5 3 import pickle 4 import torch ----> 5 from gluonnlp.data import SentencepieceTokenizer 6 from model.net import KobertCRF 7 from data_utils.utils import Config File ~/torch/lib/python3.10/site-packages/gluonnlp/__init__.py:22 19 """NLP toolkit.""" 21 import warnings ---> 22 import mxnet 24 from . import loss 25 from . import data File ~/torch/lib/python3.10/site-packages/mxnet/__init__.py:33 30 # version info 31 __version__ = base.__version__ ---> 33 from . import contrib 34 from . import ndarray 35 from . import ndarray as nd File ~/torch/lib/python3.10/site-packages/mxnet/contrib/__init__.py:30 27 from . import autograd 28 from . import tensorboard ---> 30 from . import text 31 from . import onnx 32 from . import io File ~/torch/lib/python3.10/site-packages/mxnet/contrib/text/__init__.py:23 21 from . import utils 22 from . import vocab ---> 23 from . import embedding File ~/torch/lib/python3.10/site-packages/mxnet/contrib/text/embedding.py:36 34 from ... import base 35 from ...util import is_np_array ---> 36 from ... import numpy as _mx_np 37 from ... import numpy_extension as _mx_npx 40 def register(embedding_cls): File ~/torch/lib/python3.10/site-packages/mxnet/numpy/__init__.py:23 21 from . import random 22 from . import linalg ---> 23 from .multiarray import * # pylint: disable=wildcard-import 24 from . import _op 25 from . import _register File ~/torch/lib/python3.10/site-packages/mxnet/numpy/multiarray.py:47 45 from ..ndarray.numpy import _internal as _npi 46 from ..ndarray.ndarray import _storage_type, from_numpy ---> 47 from .utils import _get_np_op 48 from .fallback import * # pylint: disable=wildcard-import,unused-wildcard-import 49 from . import fallback File ~/torch/lib/python3.10/site-packages/mxnet/numpy/utils.py:37 35 int64 = onp.int64 36 bool_ = onp.bool_ ---> 37 bool = onp.bool 39 pi = onp.pi 40 inf = onp.inf File ~/torch/lib/python3.10/site-packages/numpy/__init__.py:284, in __getattr__(attr) 281 from .testing import Tester 282 return Tester --> 284 raise AttributeError("module {!r} has no attribute " 285 "{!r}".format(__name__, attr)) AttributeError: module 'numpy' has no attribute 'bool'
https://stackoverflow.com/questions/74893742/how-to-solve-attributeerror-module-numpy-has-no-attribute-bool match the mxnet and numpy version
pip install gluonnlp mxnet==1.8.0.post0 numpy==1.22.0
https://github.com/Toblerity/Fiona/issues/1043 https://github.com/cython/cython/issues/3876