import glob import time import sys import gc from six.moves import cPickle ''' THEANO_FLAGS=mode=FAST_RUN,device=gpu0,floatX=float32,optimizer=fast_compile python MPIICook_rev.py ''' ismerge = False isGraph = False showAP = True nb_epoch = 100 print('make network and compile') if isGraph: model = makenetwork.makegraph() elif ismerge: model = makenetwork.makemergedrop2() else: model = makenetwork.makeactnet() respath = 'act_new_rgb' found = glob.glob(respath+'/model*.hdf5') mval = -1 if len(found) > 0: numlist = [] for s in found: spl = s.split('.') num = spl[0]
indval = [] indtest = [] for i,x in enumerate(setlist): if x == 1: indtrain.append(i+1) elif x == 2: indval.append(i+1) elif x == 3: indtest.append(i+1) np.random.shuffle(indtrain) # pdb.set_trace() print('make network and compile') if isGraph: model = makegraph() else: model = makenetwork() found = glob.glob(respath+'/model*.hdf5') mval = -1 if len(found) > 0: numlist = [] for s in found: spl = s.split('.') num = spl[0] num = num[5:] numlist.append(int(num)) mval = max(numlist) modpath = respath+'/model'+str(mval)+'.hdf5' print('load model from ' + modpath)