from functools import partial
from time import time
from keras.callbacks import TensorBoard
import frame_dataloader
import utils.training_utils as eval_globals
from configs.motion_configs import *
from evaluation import legacy_load_model, get_batch_size
from evaluation.evaluation import *
from models.motion_models import *
from utils import log, get_augmenter_text
from utils.drive_manager import DriveManager

################################################################################
"""Files, paths & identifier"""
suffix = "hater"  # put your name or anything(your crush :3) :D
experiment_identifier = suffix + ("" if suffix == "" else "-") + get_augmenter_text(augmenter_level) + "-mot-" + model_name + "-" + ("adam" if is_adam else "SGD") + "-" + str(lr) + "-" + ("imnet" if pretrained else "scrat")
log_file = "motion.log"
log_stream = open("motion.log", "a")
training_log = open("motion_training.log", "a")
validation_log = open("motion_validation.log", "a")
h5py_file = "motion.h5"
pred_file = "motion.preds"
################################################################################
"""Checking latest"""
print(experiment_identifier)
num_actions = 10
drive_manager = DriveManager(experiment_identifier)
checkpoint_found, zip_file_name = drive_manager.get_latest_snapshot()
################################################################################
# you need to send it as callback before keras reduce on plateau
MotionValidationCallback = partial(eval_globals.get_validation_callback,
import frame_dataloader
import utils.training_utils as eval_globals
from configs.motion_configs import *
from evaluation import legacy_load_model, get_batch_size
from evaluation.evaluation import *
from models.motion_models import *
from utils import log, get_augmenter_text
from utils.drive_manager import DriveManager

################################################################################
"""Files, paths & identifier"""
suffix = ""  # put your name or anything(your crush :3) :D
experiment_identifier = suffix + (
    "" if suffix == "" else
    "-") + get_augmenter_text(augmenter_level) + "-mot-" + model_name + "-" + (
        "adam" if is_adam else
        "SGD") + "-" + str(lr) + "-" + ("imnet" if pretrained else "scrat")
log_file = "motion.log"
log_stream = open("motion.log", "a")
h5py_file = "motion.h5"
pred_file = "motion.preds"
################################################################################
"""Checking latest"""
print(experiment_identifier)
num_actions = 101
print("Number of workers:", workers, file=log_stream)
drive_manager = DriveManager(experiment_identifier)
checkpoint_found, zip_file_name = drive_manager.get_latest_snapshot()
################################################################################
# you need to send it as callback before keras reduce on plateau