import os
import h5py
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.layers import Activation, Dropout, Flatten, Dense

model = Sequential()
model.add(Flatten(input_shape=train_data.shape[1:]))
model.add(Dense(256, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['accuracy'])

model.load_weights('bottleneck_fc_model.h5')
test_data=np.load(open('bottleneck_features_test.npy','rb'))
r=model.predict_classes(test_data)
r=r.reshape(2000,)
np.savetxt('predictions.txt',r.astype(int),fmt='%i')
