OSError when doing "from keras.preprocessing.image import ImageDataGenerator" in M1 Mac

30 Views Asked by At

I am trying to do some image classification works, and importing keras.

I followed this article, created a virtual environment(with conda), and installed keras with these,

conda install -c apple tensorflow-deps

python -m pip install tensorflow-macos
python -m pip install tensorflow-metal

Installation was successful, but when I import the library ImageDataGenerator, I got this error:

OSError: dlopen(/Users/yeung/miniforge3/envs/cv/lib/python3.8/site-packages/tensorflow/python/platform/../../core/platform/_cpu_feature_guard.so, 6): Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
  Referenced from: /Users/yeung/miniforge3/envs/cv/lib/python3.8/site-packages/tensorflow/python/platform/../../core/platform/_cpu_feature_guard.so (which was built for Mac OS X 12.3)
  Expected in: /usr/lib/libc++.1.dylib

It would be much appreciated if anyone would help. Thank you!

0

There are 0 best solutions below