def get_model(current_dir): ckpt_path = os.path.join( current_dir, '../../../dataset/trained_ckpt_file/checkpoint_lenet-10_1875.ckpt') net = Net() load_dict = load_checkpoint(ckpt_path) load_param_into_net(net, load_dict) net.set_train(False) model = ModelToBeAttacked(net) return model
def get_model(): # upload trained network current_dir = os.path.dirname(os.path.abspath(__file__)) ckpt_path = os.path.join( current_dir, '../../../dataset/trained_ckpt_file/checkpoint_lenet-10_1875.ckpt') net = Net() load_dict = load_checkpoint(ckpt_path) load_param_into_net(net, load_dict) net.set_train(False) model = ModelToBeAttacked(net) return model