AttributeError: module 'numpy' has no attribute 'typeDict'

how to fix this error ?
Traceback (most recent call last):
File “”, line 4, in
from tflite_model_maker import model_spec
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\”, line 44, in
from tflite_model_maker import audio_classifier
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tflite_model_maker\”, line 24, in
from tensorflow_examples.lite.model_maker.core.data_util.audio_dataloader import DataLoader
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow_examples\lite\model_maker\core\data_util\”, line 24, in
import tensorflow as tf
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\”, line 37, in
from import module_util as module_util
File "C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python_init
.py", line 45, in
from tensorflow.python.feature_column import feature_column_lib as feature_column
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\feature_column\”, line 18, in
from tensorflow.python.feature_column.feature_column import *
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\feature_column\”, line 143, in
from tensorflow.python.layers import base
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\layers\”, line 16, in
from tensorflow.python.keras.legacy_tf_layers import base
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\”, line 25, in
from tensorflow.python.keras import models
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\keras\”, line 22, in
from tensorflow.python.keras.engine import functional
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\keras\engine\”, line 32, in
from tensorflow.python.keras.engine import training as training_lib
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\keras\engine\”, line 52, in
from tensorflow.python.keras.saving import hdf5_format
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\tensorflow\python\keras\saving\”, line 37, in
import h5py
File “C:\Users\user\anaconda3\envs\myenv\lib\site-packages\”, line 46, in
from ._conv import register_converters as _register_converters
File “h5py\h5t.pxd”, line 14, in init h5py.conv
File “h5py\h5t.pyx”, line 293, in init h5py.h5t
File "C:\Users\user\anaconda3\envs\myenv\lib\site-packages\numpy_init
.py", line 320, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module ‘numpy’ has no attribute ‘typeDict’

What versions of the different library involved are you using, please?
Apologies for the question that follows (as much irritating like IT support telling you to reboot your computer…), but did you try out to upgrade these packages?

yes i upgrade all the packages but it gives me same error

i dont know what is other way to fix this

Hi @Jamilah_Marram_Duart. This other way around maybe? I used a computer running Python 3.8 today, and mainstream packges started to return error messages about pretty much everything e.g. data types after I upgraded Numpy to latest version (1.24.2). I had to downgrade to 1.23 to have everything working again. Very strange, as I couldn’t find recent related comments on the internet (only very old posts about much earlier Numpy versions).

@tagoma it worked on you?

Hi @Jamilah_Marram_Duart yes it did.

can i get your LinkedIn? i have questions

what is they version of your tensorflow and tflite_model_maker?

python3 -m pip install --upgrade h5py

1 Like

wow, u fix my problem!!!