i tried to make a training model with multiple inputs and outputs.
This model worked very well with single input and output but i got an error message.
AttributeError: 'numpy.ndarray' object has no attribute 'strip'
I guess the problem is that the fit_generator can't process the numpy array.
my fit generator looks like that:
def train_model(model, X_train, X_valid, y_train, y_valid):
"""
Train the model
"""
checkpoint = ModelCheckpoint('model-{epoch:03d}-Hunet-LSTM-Canny_Final_bc50.h5',
monitor='val_loss',
verbose=0,
save_best_only=True,
mode='auto')
model.compile(loss='mse', optimizer=Adam(lr=0.0001))
X=X_train
print(X)
y=y_train
print(y)
history = model.fit_generator(batcher(data_dir, X_train, y_train, batch_size, True),
samples_per_epoch,
nb_epoch,
max_q_size=1,
validation_data=batcher(data_dir, X_valid, y_valid, batch_size, False),
nb_val_samples=len(X_valid),
callbacks=[checkpoint],
verbose=1)
and the results of the Print(X_train)
[['images/photo6190.jpg' 0.119999997318]
['images/photo8791.jpg' 0.10000000149]
['images/photo12711.jpg' 0.060000006109499994]
...
['images/photo9846.jpg' 0.0700000077486]
['images/photo10800.jpg' 0.109999999404]
['images/photo2733.jpg' 0.10000000149]]
and print(y_train)
[[ 0.20000002 0.12 ]
[ 0.30000001 0.1 ]
[-0.19999999 0.06000001]
...
[ 0.30000001 0.07000001]
[ 0.5 0.11 ]
[ 0.40000001 0.1 ]]
Any idea to fixing it?