Skip to content
Snippets Groups Projects
Commit ed41a945 authored by Michael Langguth's avatar Michael Langguth
Browse files

First initial release of config_train.py, which is still incomplete....

First initial release of config_train.py, which is still incomplete. .gitignore has also been adapted.
parent e3bcd53e
No related branches found
No related tags found
No related merge requests found
Pipeline #49933 failed
......@@ -124,6 +124,7 @@ virt_env*/
# Ignore (Batch) runscripts
video_prediction_tools/HPC_scripts/**
!video_prediction_tools/HPC_scripts/*_template.sh
!video_predcition_tools/HPC_scripts/config_train.py
video_prediction_tools/Zam347_scripts/**
!video_prediction_tools/Zam347_scripts/*_template.sh
!video_predcition_tools/Zam347_scripts/config_train.py
"""
Basic task of the Python-script:
Creates user-defined runscripts for training, set ups a user-defined target directory and allows for full control
on the setting of hyperparameters.
"""
__email__ = "b.gong@fz-juelich.de"
__authors__ = "Bing Gong, Scarlet Stadtler,Michael Langguth"
__date__ = "2020-10-27"
# import modules
import sys, os, glob
import numpy as np
import datetime as dt
import json as js
import metadata
sys.path.append(path.abspath('../video_prediction/'))
from models import get_model_class
known_architectures = ["savp","convLSTM","vae","mcnet"]
if not (model in known_architectures):
# start script
def main():
# get required information from the user by keyboard interaction
# path to preprocessed data
exp_dir = input("Enter the path to the preprocessed data (directory where tf-records files are located):\n")
exp_dir = os.path.join(exp_dir,"train")
# sanity check (does preprocessed data exist?)
if not (os.path.isdir(exp_dir)):
raise NotADirectoryError("Passed path to preprocessed data '"+exp_dir+"' does not exist!")
file_list = glob.glob(os.path.join(exp_dir,"sequence*.tfrecords"))
if len(file_list) == 0:
raise FileNotFoundError("Passed path to preprocessed data '"+exp_dir+"' exists,"+\
"but no tfrecord-files can be found therein")
# path to virtual environment to be used
venv_name = input("Enter the name of the virtual environment which should be used:\n")
# sanity check (does virtual environment exist?)
if not (os.path.isfile("../",venv_name,"bin","activate")):
raise FileNotFoundError("Could not find a virtual environment named "+venv_name)
# model
# experimental ID
exp_id = input("Enter your desired experimental id:\n")
# also get current timestamp and user-name
timestamp = dt.datetime.now().strftime("%Y%m%dT%H%M%S")
user_name = os.environ["USER"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment