深度学习实战代码40例(4)——GAN对自己的数据进行增强

from __future__ import print_function, division
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout
from tensorflow.keras.layers import BatchNormalization, Activation, ZeroPadding2D
# from keras.layers.advanced_activations import LeakyReLU
from tensorflow.keras.activations import relu
# from tensorflow.keras.layers.convolutional import UpSampling2D, Conv2D
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.optimizers import Adam
import cv2 as cv
import matplotlib.pyplot as plt

import sys
import os
import numpy as np
import PySide2

config = tf.compat.v1.ConfigProto(gpu_options=tf.compat.v1.GPUOptions(allow_growth=True))
sess = tf.compat.v1.Session(config=config)

def read_images(path):
    train_images = []
    for i in range(30):
        image = cv.imread(path + '/' + str(i + 1) 

你可能感兴趣的:(深度学习实战代码40例,tensorflow,人工智能,python)