def test_save_config_hookjson_config(): from smdebug.core.json_config import CONFIG_FILE_PATH_ENV_STR out_dir = "/tmp/test_hook_from_json_config_full" shutil.rmtree(out_dir, True) os.environ[ CONFIG_FILE_PATH_ENV_STR] = "tests/mxnet/test_json_configs/test_save_config_hookjson_config.json" hook = t_hook.create_from_json_file() test_save_config(hook=hook) shutil.rmtree(out_dir, True)
def test_hook_from_json_config_full(): out_dir = "/tmp/newlogsRunTest2/test_hook_from_json_config_full" shutil.rmtree(out_dir, True) os.environ[ CONFIG_FILE_PATH_ENV_STR] = "tests/mxnet/test_json_configs/test_hook_from_json_config_full.json" hook = t_hook.create_from_json_file() assert has_training_ended(out_dir) == False run_mnist_gluon_model(hook=hook, num_steps_train=10, num_steps_eval=10, register_to_loss_block=True) shutil.rmtree(out_dir, True)
def test_save_all_hook_from_json(): from smdebug.core.json_config import CONFIG_FILE_PATH_ENV_STR import os out_dir = "/tmp/newlogsRunTest2/test_hook_save_all_hook_from_json" shutil.rmtree(out_dir, True) os.environ[ CONFIG_FILE_PATH_ENV_STR] = "tests/mxnet/test_json_configs/test_hook_save_all_hook.json" hook = t_hook.create_from_json_file() test_save_all(hook, out_dir) # delete output shutil.rmtree(out_dir, True)
def test_modes_hook_from_json_config(): from smdebug.core.json_config import CONFIG_FILE_PATH_ENV_STR import shutil import os out_dir = "/tmp/test_modes_hookjson" shutil.rmtree(out_dir, True) os.environ[ CONFIG_FILE_PATH_ENV_STR] = "tests/mxnet/test_json_configs/test_modes_hook.json" hook = t_hook.create_from_json_file() test_modes(hook, out_dir) shutil.rmtree(out_dir, True)