关于stable diffusion 问题
我用图生图局部重绘,骨架图都弄好了,我看了教程,设置完全没问题,但是却总是生成不出模特,生成出来的都是原图,请问是怎么回事?
关于stable diffusion 问题
我用图生图局部重绘,骨架图都弄好了,我看了教程,设置完全没问题,但是却总是生成不出模特,生成出来的都是原图,请问是怎么回事?
让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如需一对一服务私聊我哦可能的原因有以下几点:
from keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale = 1./255,
shear_range = 0.2,
zoom_range = 0.2,
horizontal_flip = True)
test_datagen = ImageDataGenerator(rescale = 1./255)
training_set = train_datagen.flow_from_directory('training_set',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
test_set = test_datagen.flow_from_directory('test_set',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
model.fit_generator(training_set,
steps_per_epoch = 8000,
epochs = 25,
validation_data = test_set,
validation_steps = 2000)
model.fit(X_train, y_train,
batch_size=128,
epochs=50,
validation_data=(X_test, y_test))
from keras.callbacks import LearningRateScheduler
def step_decay(epoch):
initial_lrate = 0.1
drop = 0.5
epochs_drop = 10.0
lrate = initial_lrate * math.pow(drop,
math.floor((1+epoch)/epochs_drop))
return lrate
lrate = LearningRateScheduler(step_decay)
model.fit(X_train, y_train,
validation_data=(X_test, y_test),
epochs=50,
batch_size=128,
callbacks=[lrate])
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
model = Sequential()
model.add(Conv2D(32, (3,3), input_shape = (64, 64, 3), activation = 'relu'))
model.add(MaxPooling2D(pool_size = (2,2)))
model.add(Conv2D(64, (3,3), activation = 'relu'))
model.add(MaxPooling2D(pool_size = (2,2)))
model.add(Conv2D(128, (3,3), activation = 'relu'))
model.add(MaxPooling2D(pool_size = (2,2)))
model.add(Flatten())
model.add(Dense(units = 128, activation = 'relu'))
model.add(Dense(units = 1, activation = 'sigmoid'))
model.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
model.fit(X_train, y_train, epochs = 25, batch_size = 32, validation_data = (X_test, y_test))
from keras.losses import mean_squared_error
model.compile(optimizer = 'adam', loss = mean_squared_error, metrics = ['accuracy'])
model.fit(X_train, y_train, epochs = 25, batch_size = 32, validation_data = (X_test, y_test))
from keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale = 1./255,
shear_range = 0.2,
zoom_range = 0.2,
horizontal_flip = True)
test_datagen = ImageDataGenerator(rescale = 1./255)
training_set = train_datagen.flow_from_directory('training_set',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
test_set = test_datagen.flow_from_directory('test_set',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
model.fit_generator(training_set,
steps_per_epoch = 8000,
epochs = 25,
validation_data = test_set,
validation_steps = 2000)