MCPcopy
hub / github.com/andabi/deep-voice-conversion / eval

Function eval

eval2.py:25–51  ·  view source on GitHub ↗
(logdir1, logdir2)

Source from the content-addressed store, hash-verified

23
24
25def eval(logdir1, logdir2):
26 # Load graph
27 model = Net2()
28
29 # dataflow
30 df = Net2DataFlow(hp.test2.data_path, hp.test2.batch_size)
31
32 ckpt1 = tf.train.latest_checkpoint(logdir1)
33 ckpt2 = tf.train.latest_checkpoint(logdir2)
34 session_inits = []
35 if ckpt2:
36 session_inits.append(SaverRestore(ckpt2))
37 if ckpt1:
38 session_inits.append(SaverRestore(ckpt1, ignore=['global_step']))
39 pred_conf = PredictConfig(
40 model=model,
41 input_names=get_eval_input_names(),
42 output_names=get_eval_output_names(),
43 session_init=ChainInit(session_inits))
44 predictor = OfflinePredictor(pred_conf)
45
46 x_mfccs, y_spec, _ = next(df().get_data())
47 summ_loss, = predictor(x_mfccs, y_spec)
48
49 writer = tf.summary.FileWriter(logdir2)
50 writer.add_summary(summ_loss)
51 writer.close()
52
53
54def get_arguments():

Callers 1

eval2.pyFile · 0.70

Calls 5

Net2Class · 0.90
Net2DataFlowClass · 0.90
get_eval_input_namesFunction · 0.70
get_eval_output_namesFunction · 0.70
get_dataMethod · 0.45

Tested by

no test coverage detected