![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
keras学习笔记
feng3702592
这个作者很懒,什么都没留下…
展开
-
keras文件读取
import tensorflow as tfimport tensorflow.keras as kerasimport matplotlib.pyplot as pltimport osimport PILimport pathlibimport mathimport randomimport numpy as npimport shutilimport PIL# 划出测试图像def div_train_test(data_dir): data_dir = pathli.原创 2021-09-11 17:58:38 · 746 阅读 · 0 评论 -
tf2多种方式对图像数据集进行预处理
import tensorflow as tfimport tensorflow.keras as kerasimport matplotlib.pyplot as pltAUTOTUNE=tf.data.experimental.AUTOTUNE#用CPU动态设置并行调用的数量import pathlib#示例将从url上下载的数据进行处理# data_root_orig=keras.utils.get_file(origin='https://storage.googleapis.com/.原创 2021-09-07 15:28:05 · 680 阅读 · 0 评论 -
用preprocessing.image_dataset_from_directory处理数据后送入VGG16
import tensorflow as tfimport tensorflow.keras as kerasimport matplotlib.pyplot as pltimport osimport PILimport pathlibimport numpy as npdata_dir=('data-class')data_dir=pathlib.Path(data_dir)image_count=len(list(data_dir.glob('*/*')))print(image.原创 2021-09-09 10:22:45 · 301 阅读 · 0 评论