As a Python 3.9.7
user, I created an environment which has: tensorflow-gpu==2.6.0
, keras==2.6.0
and also using imageai
, however, whenever I run the code, I get the error:
File "C:\Users\project-name\.venv\lib\site-packages\imageai\Detection\YOLOv3\models.py"
ImportError: cannot import name 'BatchNormalization' from 'keras.layers.normalization'
I know that this is related to tensorflow 2.0, as this error gets corrected if I write manually:
from tensorflow.keras.layers.normalization import BatchNormalization
But it appears in many other files inside the .venv. How could I possibly solve this error for all the files?
好的,那么设法解决依赖冲突的是 - 在安装所有要求之后,我更新了imageai
:
pip install imageai --upgrade
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.