RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback): cannot import name 'AutoModelForImageToImage' from 'transformers.models.auto.modeling_auto' (/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/models/auto/modeling_auto.py)
Author: LucaYoy
Pull request: no

Hi I also have a similar issue to #23340 but this type numpy is the culprit

```cannot import name 'AutoModelForImageToImage' from 'transformers.models.auto.modeling_auto' (/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/models/auto/modeling_auto.py)
```

transformers-cli env gives:

```
To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-12-11 13:51:15.375941: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1382, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "/opt/conda/envs/prototype/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/models/auto/image_processing_auto.py", line 26, in <module>
    from ...image_processing_utils import ImageProcessingMixin
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/image_processing_utils.py", line 28, in <module>
    from .image_transforms import center_crop, normalize, rescale
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/image_transforms.py", line 47, in <module>
    import tensorflow as tf
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/__init__.py", line 38, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 45, in <module>
    from tensorflow.python.feature_column import feature_column_lib as feature_column
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/feature_column/feature_column_lib.py", line 18, in <module>
    from tensorflow.python.feature_column.feature_column import *
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/feature_column/feature_column.py", line 143, in <module>
    from tensorflow.python.layers import base
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/layers/base.py", line 16, in <module>
    from tensorflow.python.keras.legacy_tf_layers import base
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/keras/__init__.py", line 25, in <module>
    from tensorflow.python.keras import models
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/keras/models.py", line 22, in <module>
    from tensorflow.python.keras.engine import functional
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/keras/engine/functional.py", line 32, in <module>
    from tensorflow.python.keras.engine import training as training_lib
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py", line 53, in <module>
    from tensorflow.python.keras.saving import hdf5_format
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 37, in <module>
    import h5py
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/h5py/__init__.py", line 46, in <module>
    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 "/opt/conda/envs/prototype/lib/python3.8/site-packages/numpy/__init__.py", line 320, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'typeDict'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/envs/prototype/bin/transformers-cli", line 5, in <module>
    from transformers.commands.transformers_cli import main
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/commands/transformers_cli.py", line 24, in <module>
    from .pt_to_tf import PTtoTFCommand
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/commands/pt_to_tf.py", line 24, in <module>
    from .. import (
  File "<frozen importlib._bootstrap>", line 1039, in _handle_fromlist
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1373, in __getattr__
    value = getattr(module, name)
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1372, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/opt/conda/envs/prototype/lib/python3.8/site-packages/transformers/utils/import_utils.py", line 1384, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.models.auto.image_processing_auto because of the following error (look up to see its traceback):
module 'numpy' has no attribute 'typeDict
```

Im using: 
Numpy 1.24.4
Torch 2.1.1+cu118
Transformers 4.36.0

Comments:
Hi @LucaYoy, thanks for raising this issue! 

Which version of tensorflow are you running in your environment? 

@amyeroberts im using 2.13.0

It seems this is an incompatibility between numpy and tensorflow or tensorflow-related libraries. You'll need to find compatible versions to get things to run. There's a related discussion on the [tensorflow forum](https://discuss.tensorflow.org/t/attributeerror-module-numpy-has-no-attribute-typedict/14929) which people suggest upgrading h5py: `python3 -m pip install --upgrade h5py`

We're still getting this issue, specially with `mistral` and derivatives models... upgrade all possible libraries didn't make any changes:
```
RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback):
<lambda>() takes 0 positional arguments but 1 was given
```
Hope you can provide the `requirements.txt` of the working versions for each of the underling dependencies...

Hi @bitsnaps, without knowing which versions of the libraries you're running and the full error message, we won't be able to help you. You can find our list of dependencies and any specific versions under [our setup.py file](https://github.com/huggingface/transformers/blob/main/setup.py).

Did you try upgrading h5py, [as suggested in the forum posts](https://discuss.tensorflow.org/t/attributeerror-module-numpy-has-no-attribute-typedict/14929)?  

Hi @amyeroberts, thanks for all the details, after digging a little more deeper into this issue in that particular case, I found that it has to do with an old [colab issue](https://github.com/googlecolab/colabtools/issues/3409) but only when installing langchain first, I had to load the model before install langchain, and yep, I've already tried to upgrade many packages including `h5py`.

@bitsnaps Thanks for the update!