When I am importing from kuti package, it triggers an import h5py which is causing me a lot of grief! It is giving me an attribute error: "module 'numpy' has no attribute 'typeDict'"
AttributeError Traceback (most recent call last) /home/ack253/neuroaesthetics/ava-mlsp/predict_mlsp_wide.ipynb Cell 5 line 2 1 import pandas as pd, numpy as np, os ----> 2 from kuti import image_utils as img
File ~/.local/lib/python3.8/site-packages/kuti/init.py:8 5 import warnings 6 warnings.filterwarnings('ignore',category=FutureWarning) ----> 8 from . import generic, tensor_ops, image_utils, generators, model_helper, applications 10 # remove tensorflow warnings 11 import logging
File ~/.local/lib/python3.8/site-packages/kuti/generic.py:10 8 import numpy as np, pandas as pd 9 import multiprocessing as mp ---> 10 import os, scipy, h5py, time, sys 11 import urllib, shutil, subprocess 12 from munch import Munch
File ~/.local/lib/python3.8/site-packages/h5py/init.py:46 37 _warn(("h5py is running against HDF5 {0} when it was built against {1}, " 38 "this may cause problems").format( 39 '{0}.{1}.{2}'.format(*version.hdf5_version_tuple), 40 '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple) ... 318 return Tester --> 320 raise AttributeError("module {!r} has no attribute " 321 "{!r}".format(name, attr))
AttributeError: module 'numpy' has no attribute 'typeDict'
[Here is a screenshot of my code: ]](https://i.stack.imgur.com/yyNhh.png)
It will be a version problem with the version of h5py you are using.
np.typeDict is a deprecated alias for np.sctypeDict and was removed after numpy 1.21.
A likely quick fix would be to install a specific version that supports it:
pip install numpy==1.21However, you likely have other modules that use a newer/up to date version. I don't know which version of h5py you have but it's possible that just updating that would resolve it:
pip install --upgrade h5py