小白踩坑日记004
本文长期更新
记录一系列小问题的解决
0421:配置cv2
conda activate tf2
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ opencv-contrib-python
这是给pychrm的环境配的
下面是给jupyter notebook配的
conda activate base
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ opencv-contrib-python
0422:
如果在jupyter notebook中遇到这样的问题
只要在代码中添加
%matplotlib inline
即可解决
0423:
若遇到关于
ImageDataGenerator not defined 报错
1 在代码中添加
from keras.preprocessing.image import ImageDataGenerator
即可解决 或者
把原文比如
train_datagen = ImageDataGenerator(rescale=1./255)
修改成
train_datagen = keras.preprocessing.image.ImageDataGenerator(rescale=1./255)
即可解决 当然 如果需要 还要加上
import keras 就行了
0424
出现错误:AttributeError: module ‘tensorflow’ has no attribute ‘pla