当前位置:   article > 正文

python3.8搭建Keras +TensorFlow环境_python3.8安装tensorflow,keras的版本

python3.8安装tensorflow,keras的版本
  1. # pip install numpy==1.20 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
  2. # Keras 2.3.1 TensorFlow2.4.1 numpy>=1.20 protobuf==3.20.1 python3.8
  1. import tensorflow as tf
  2. # pip install numpy==1.20 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
  3. # Keras 2.3.1 TensorFlow2.4.1 numpy>=1.20 protobuf==3.20.1 python3.8
  4. from tensorflow import keras
  5. from tensorflow.keras import layers,models
  6. import pathlib
  7. import keras
  8. import matplotlib.pyplot as plt
  9. import numpy as np
  10. import os
  11. import PIL
  12. print(keras.__version__)
  13. print(tf.__version__)
  14. data_dir = "flower_photos"
  15. data_dir = pathlib.Path(data_dir)
  16. image_count = len(list(data_dir.glob('*/*.jpg')))
  17. print("图片总数为:",image_count)
  18. roses = list(data_dir.glob('roses/*'))
  19. im=PIL.Image.open(str(roses[0]))
  20. im.sho
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/475763
推荐阅读
相关标签
  

闽ICP备14008679号