First, we start with some import statements and helper functions that help us check directory paths and find the latest model version:
import argparseimport loggingimport osimport randomimport socketimport sysimport timeimport arghimport tensorflow as tffrom tensorflow import gfilefrom tqdm import tqdmimport alphagozero_agentimport networkimport preprocessingfrom config import GLOBAL_PARAMETER_STOREfrom constants import PATHSfrom alphagozero_agent import play_matchfrom network import PolicyValueNetworkfrom utils import logged_timer as timerfrom utils import print_flags, generate, detect_model_name, detect_model_versionlogging.basicConfig( level=logging.DEBUG, handlers=[logging.StreamHandler(sys.stdout)], format='%(asctime)s ...