Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment test cases have reference to user path #165

Open
shuttle1987 opened this issue Jun 2, 2018 · 1 comment
Open

Experiment test cases have reference to user path #165

shuttle1987 opened this issue Jun 2, 2018 · 1 comment

Comments

@shuttle1987
Copy link
Member

shuttle1987 commented Jun 2, 2018

@pytest.mark.experiment
def test_reuse_model(preprocess_na):
tgt_dir = Path(config.TEST_DATA_PATH) / "na"
na_corpus = na.Corpus("fbank_and_pitch", "phonemes_and_tones",
tgt_dir=tgt_dir)
na_reader = corpus_reader.CorpusReader(na_corpus)
logging.info("na_corpus {}".format(na_corpus))
logging.info("na_corpus.get_untranscribed_fns():")
logging.info(pprint.pformat(na_corpus.get_untranscribed_fns()))
# TODO Currently assumes we're on slug. Need to package up the model and
# put it on cloudstor, then create a fixture to download it.
exp_dir = prep_exp_dir(directory=config.TEST_EXP_PATH)
model = rnn_ctc.Model(exp_dir, na_reader, num_layers=3, hidden_size=400)
model.transcribe(restore_model_path="/home/oadams/code/mam/exp/252/model/model_best.ckpt")

This test depends on being able to locate a Tensorflow checkpoint file in a local directory. This will fail for other users.

Same with:

@pytest.mark.experiment
def test_load_saver():
tgt_dir = Path(config.TEST_DATA_PATH) / "na"
na_corpus = na.Corpus("fbank_and_pitch", "phonemes_and_tones",
tgt_dir=tgt_dir)
na_reader = corpus_reader.CorpusReader(na_corpus)
model_prefix_path = "/home/oadams/code/mam/exp/252/model/model_best.ckpt"
saver = tf.train.Saver()

And

@pytest.mark.experiment
def test_load_meta():
tgt_dir = Path(config.TEST_DATA_PATH) / "na"
na_corpus = na.Corpus("fbank_and_pitch", "phonemes_and_tones",
tgt_dir=tgt_dir)
na_reader = corpus_reader.CorpusReader(na_corpus)
tf.reset_default_graph()
model_prefix_path = "/home/oadams/code/mam/exp/252/model/model_best.ckpt"

@shuttle1987
Copy link
Member Author

Creating a minimal test corpus as per #166 will make this far less of a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant