allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.73k stars 2.24k forks source link

conda install allennlp #1599

Closed izzykayu closed 6 years ago

izzykayu commented 6 years ago

Hi I am wondering if conda install allennlp exists? I work at a medical center that does not allow us to use pip even when creating our virtual environments, however we can use conda install. I would love the opportunity to use allennlp for my clinical nlp tasks.

If there is any way for conda install allennlp to work or even conda-forge, please let me know.

Also, if anyone knows any other way to get around this, please reply! Any tips would be greatly appreciated :)

nelson-liu commented 6 years ago

Surprising that you aren't allowed to use pip, even when you've installed it via conda. Regardless, I've been building conda binaries for the last couple allennlp releases (see https://anaconda.org/allennlp/allennlp).

You can install it (and all of its dependencies, like pytorch) with conda install allennlp -c pytorch -c allennlp -c conda-forge .

~As of right now, you also need conda install pytest to make it work, and if you additionally install responses and flaky (via conda install responses flaky) you can run allennlp test-install to verify that the setup is working. I've set up a PR to automatically bundle these dependencies (https://github.com/nelson-liu/allennlp-feedstock/pull/5), so once that's been merged you won't need to install these additional packages.~

edit: you can just run the command above and then run allennlp test-install to verify that the package installed properly.

Hope that helps!

izzykayu commented 6 years ago

Thank you so much! 1 failed, 735 passed, 6 skipped, 10 deselected after running allennlp test-install but I will still submit a job to the cluster and see how it does~~ . Thanks again I really appreciate it

nelson-liu commented 6 years ago

out of curiosity: what was the failing test? Can you give a stack trace? That shouldn't be happening...

AliceGab commented 5 years ago

I had similar warnings :


2018-10-24 12:29:21,790 - INFO - allennlp.commands.test_install - Changing directory to /anaconda3/lib/python3.6/site-packages/allennlp
2018-10-24 12:29:21,792 - INFO - allennlp.commands.test_install - Running tests at /anaconda3/lib/python3.6/site-packages/allennlp/tests
============================= test session starts ==============================
platform darwin -- Python 3.6.6, pytest-3.9.2, py-1.7.0, pluggy-0.8.0
rootdir: /anaconda3/lib/python3.6/site-packages/allennlp, inifile:
plugins: remotedata-0.3.0, openfiles-0.3.0, doctestplus-0.1.3, arraydiff-0.2, flaky-3.4.0
collected 752 items / 10 deselected

tests/commands/configure_test.py .                                       [  0%]
tests/commands/dry_run_test.py .                                         [  0%]
tests/commands/elmo_test.py .........                                    [  1%]
tests/commands/evaluate_test.py .                                        [  1%]
tests/commands/fine_tune_test.py ...                                     [  2%]
tests/commands/main_test.py ...                                          [  2%]
tests/commands/make_vocab_test.py ...                                    [  2%]
tests/commands/predict_test.py .......                                   [  3%]
tests/commands/test_install_test.py .                                    [  3%]
tests/commands/train_test.py ......                                      [  4%]
tests/common/configuration_test.py ....                                  [  5%]
tests/common/file_utils_test.py .....                                    [  5%]
tests/common/params_test.py ....                                         [  6%]
tests/common/registrable_test.py .............                           [  8%]
tests/common/test_util.py ......                                         [  9%]
tests/custom_extensions/alternating_highway_lstm_test.py sss             [  9%]
tests/data/dataset_test.py ...                                           [  9%]
tests/data/vocabulary_test.py ...............                            [ 11%]
tests/data/dataset_readers/conll2003_dataset_reader_test.py ....         [ 12%]
tests/data/dataset_readers/language_modeling_dataset_test.py ..          [ 12%]
tests/data/dataset_readers/lazy_dataset_reader_test.py ..                [ 12%]
tests/data/dataset_readers/nlvr_test.py ....                             [ 13%]
tests/data/dataset_readers/penn_tree_bank_reader_test.py ....            [ 14%]
tests/data/dataset_readers/seq2seq_test.py ...                           [ 14%]
tests/data/dataset_readers/sequence_tagging_test.py ...                  [ 14%]
tests/data/dataset_readers/snli_reader_test.py ..                        [ 15%]
tests/data/dataset_readers/srl_dataset_reader_test.py ...                [ 15%]
tests/data/dataset_readers/stanford_sentiment_tree_bank_test.py ......   [ 16%]
tests/data/dataset_readers/universal_dependencies_dataset_reader_test.py . [ 16%]
                                                                         [ 16%]
tests/data/dataset_readers/wikitables_test.py ....                       [ 16%]
tests/data/dataset_readers/coreference/coref_reader_test.py ..           [ 17%]
tests/data/dataset_readers/coreference/winobias_reader_test.py ..        [ 17%]
tests/data/dataset_readers/dataset_utils/ontonotes_test.py ...           [ 17%]
tests/data/dataset_readers/dataset_utils/span_utils_test.py .....        [ 18%]
tests/data/dataset_readers/reading_comprehension/squad_test.py ...       [ 19%]
tests/data/dataset_readers/reading_comprehension/triviaqa_test.py ..     [ 19%]
tests/data/dataset_readers/reading_comprehension/util_test.py ..         [ 19%]
tests/data/fields/array_field_test.py .....                              [ 20%]
tests/data/fields/index_field_test.py ....                               [ 20%]
tests/data/fields/knowledge_graph_field_test.py ........                 [ 21%]
tests/data/fields/label_field_test.py .......                            [ 22%]
tests/data/fields/list_field_test.py ..........                          [ 24%]
tests/data/fields/multilabel_field_test.py ..........                    [ 25%]
tests/data/fields/production_rule_field_test.py ......                   [ 26%]
tests/data/fields/sequence_label_field_test.py .......                   [ 27%]
tests/data/fields/span_field_test.py ......                              [ 28%]
tests/data/fields/text_field_test.py .........                           [ 29%]
tests/data/iterators/adaptive_iterator_test.py ....                      [ 29%]
tests/data/iterators/basic_iterator_test.py ..........                   [ 31%]
tests/data/iterators/bucket_iterator_test.py ....                        [ 31%]
tests/data/iterators/epoch_tracking_bucket_iterator_test.py .            [ 31%]
tests/data/token_indexers/character_token_indexer_test.py ...            [ 32%]
tests/data/token_indexers/dep_label_indexer_test.py ....                 [ 32%]
tests/data/token_indexers/elmo_indexer_test.py ....                      [ 33%]
tests/data/token_indexers/ner_tag_indexer_test.py ....                   [ 33%]
tests/data/token_indexers/pos_tag_indexer_test.py ....                   [ 34%]
tests/data/token_indexers/single_id_token_indexer_test.py ..             [ 34%]
tests/data/tokenizers/character_tokenizer_test.py ...                    [ 35%]
tests/data/tokenizers/word_splitter_test.py ................             [ 37%]
tests/data/tokenizers/word_tokenizer_test.py ...                         [ 37%]
tests/models/archival_test.py ..                                         [ 37%]
tests/models/biattentive_classification_network_test.py ..........F      [ 39%]
tests/models/constituency_parser_test.py ........                        [ 40%]
tests/models/crf_tagger_test.py ....                                     [ 40%]
tests/models/decomposable_attention_test.py .....                        [ 41%]
tests/models/semantic_role_labeler_test.py .......                       [ 42%]
tests/models/simple_tagger_test.py ......                                [ 43%]
tests/models/coreference_resolution/coref_test.py ..                     [ 43%]
tests/models/encoder_decoders/simple_seq2seq_test.py ....                [ 44%]
tests/models/reading_comprehension/bidaf_ensemble_test.py ...            [ 44%]
tests/models/reading_comprehension/bidaf_test.py .....                   [ 45%]
tests/models/semantic_parsing/nlvr/nlvr_coverage_semantic_parser_test.py . [ 45%]
......                                                                   [ 46%]
tests/models/semantic_parsing/nlvr/nlvr_direct_semantic_parser_test.py . [ 46%]
                                                                         [ 46%]
tests/models/semantic_parsing/wikitables/wikitables_decoder_step_test.py . [ 46%]
.....                                                                    [ 47%]
tests/models/semantic_parsing/wikitables/wikitables_erm_semantic_parser_test.py . [ 47%]
                                                                         [ 47%]
tests/models/semantic_parsing/wikitables/wikitables_mml_semantic_parser_test.py . [ 47%]
.......                                                                  [ 48%]
tests/modules/augmented_lstm_test.py ......                              [ 49%]
tests/modules/conditional_random_field_test.py .....                     [ 49%]
tests/modules/elmo_test.py ...........                                   [ 51%]
tests/modules/encoder_base_test.py ...                                   [ 51%]
tests/modules/feedforward_test.py ...                                    [ 52%]
tests/modules/highway_test.py ..                                         [ 52%]
tests/modules/lstm_cell_with_projection_test.py .                        [ 52%]
tests/modules/maxout_test.py ....                                        [ 53%]
tests/modules/scalar_mix_test.py ...                                     [ 53%]
tests/modules/seq2seq_encoder_test.py ..                                 [ 53%]
tests/modules/seq2vec_encoder_test.py ..                                 [ 54%]
tests/modules/span_pruner_test.py ...                                    [ 54%]
tests/modules/stacked_alternating_lstm_test.py ..                        [ 54%]
tests/modules/stacked_bidirectional_lstm_test.py ..                      [ 54%]
tests/modules/stacked_elmo_lstm_test.py .                                [ 55%]
tests/modules/time_distributed_test.py ..                                [ 55%]
tests/modules/attention/bilinear_attention_test.py .                     [ 55%]
tests/modules/attention/cosine_attention_test.py ..                      [ 55%]
tests/modules/attention/dot_product_attention_test.py ..                 [ 56%]
tests/modules/attention/legacy_attention_test.py .......                 [ 57%]
tests/modules/attention/linear_attention_test.py ..                      [ 57%]
tests/modules/matrix_attention/bilinear_matrix_attention_test.py .       [ 57%]
tests/modules/matrix_attention/cosine_matrix_attention_test.py ..        [ 57%]
tests/modules/matrix_attention/dot_product_matrix_attention_test.py ..   [ 57%]
tests/modules/matrix_attention/legacy_matrix_attention_test.py ..        [ 58%]
tests/modules/matrix_attention/linear_matrix_attention_test.py ..        [ 58%]
tests/modules/seq2seq_encoders/intra_sentence_attention_test.py ....     [ 59%]
tests/modules/seq2seq_encoders/multi_head_self_attention_test.py ...     [ 59%]
tests/modules/seq2seq_encoders/pass_through_encoder_test.py ..           [ 59%]
tests/modules/seq2seq_encoders/pytorch_seq2seq_wrapper_test.py ......... [ 60%]
..                                                                       [ 61%]
tests/modules/seq2seq_encoders/stacked_self_attention_test.py ..         [ 61%]
tests/modules/seq2vec_encoders/boe_encoder_test.py .....                 [ 62%]
tests/modules/seq2vec_encoders/cnn_encoder_test.py ....                  [ 62%]
tests/modules/seq2vec_encoders/pytorch_seq2vec_wrapper_test.py ......    [ 63%]
tests/modules/similarity_functions/bilinear_test.py ....                 [ 64%]
tests/modules/similarity_functions/cosine_test.py ...                    [ 64%]
tests/modules/similarity_functions/dot_product_test.py ...               [ 64%]
tests/modules/similarity_functions/linear_test.py ........               [ 65%]
tests/modules/similarity_functions/multiheaded_test.py ..                [ 66%]
tests/modules/span_extractors/bidirectional_endpoint_span_extractor_test.py . [ 66%]
....                                                                     [ 66%]
tests/modules/span_extractors/endpoint_span_extractor_test.py ....       [ 67%]
tests/modules/span_extractors/self_attentive_span_extractor_test.py ..   [ 67%]
tests/modules/text_field_embedders/basic_text_field_embedder_test.py ... [ 68%]
..                                                                       [ 68%]
tests/modules/token_embedders/elmo_token_embedder_test.py ....           [ 68%]
tests/modules/token_embedders/embedding_test.py ......                   [ 69%]
tests/modules/token_embedders/token_characters_encoder_test.py ..        [ 69%]
tests/nn/initializers_test.py ....                                       [ 70%]
tests/nn/regularizers_test.py ....                                       [ 71%]
tests/nn/util_test.py ...............................                    [ 75%]
tests/nn/decoding/beam_search_test.py .                                  [ 75%]
tests/nn/decoding/constrained_beam_search_test.py .                      [ 75%]
tests/nn/decoding/grammar_state_test.py .......                          [ 76%]
tests/nn/decoding/util_test.py .                                         [ 76%]
tests/nn/decoding/decoder_trainers/expected_risk_minimization_test.py .. [ 76%]
                                                                         [ 76%]
tests/nn/decoding/decoder_trainers/maximum_marginal_likelihood_test.py . [ 76%]
                                                                         [ 76%]
tests/predictors/bidaf_test.py ..                                        [ 77%]
tests/predictors/constituency_parser_test.py ...                         [ 77%]
tests/predictors/coref_test.py .                                         [ 77%]
tests/predictors/decomposable_attention_test.py ..                       [ 78%]
tests/predictors/nlvr_parser_test.py ..                                  [ 78%]
tests/predictors/simple_seq2seq_test.py .                                [ 78%]
tests/predictors/srl_test.py ...                                         [ 78%]
tests/predictors/wikitables_parser_test.py ..                            [ 79%]
tests/semparse/action_space_walker_test.py ..                            [ 79%]
tests/semparse/util_test.py .                                            [ 79%]
tests/semparse/contexts/table_question_knowledge_graph_test.py ......... [ 80%]
...............                                                          [ 82%]
tests/semparse/type_declarations/type_declaration_test.py .......        [ 83%]
tests/semparse/type_declarations/wikitables_type_declaration_test.py ... [ 84%]
.                                                                        [ 84%]
tests/semparse/worlds/nlvr_world_test.py ...................             [ 86%]
tests/semparse/worlds/wikitables_world_test.py ....s.........            [ 88%]
tests/semparse/worlds/world_test.py ..............                       [ 90%]
tests/service/config_explorer_test.py ..........                         [ 91%]
tests/service/server_flask_test.py ..........                            [ 93%]
tests/service/server_simple_test.py ...                                  [ 93%]
tests/training/learning_rate_schedulers_test.py ....                     [ 94%]
tests/training/optimizer_test.py ..                                      [ 94%]
tests/training/trainer_test.py ..........ss......                        [ 96%]
tests/training/metrics/boolean_accuracy_test.py .                        [ 97%]
tests/training/metrics/categorical_accuracy_test.py ......               [ 97%]
tests/training/metrics/entropy_test.py ...                               [ 98%]
tests/training/metrics/evalb_bracketing_scorer_test.py ....              [ 98%]
tests/training/metrics/f1_measure_test.py ....                           [ 99%]
tests/training/metrics/span_based_f1_measure_test.py ....                [ 99%]
tests/training/metrics/wikitables_accuracy_test.py .                     [100%]

=================================== FAILURES ===================================
 BiattentiveClassificationNetworkTest.test_output_only_elmo_bcn_can_train_save_and_load

self = <allennlp.tests.models.biattentive_classification_network_test.BiattentiveClassificationNetworkTest testMethod=test_output_only_elmo_bcn_can_train_save_and_load>

    def test_output_only_elmo_bcn_can_train_save_and_load(self):
        # pylint: disable=line-too-long
>       self.ensure_model_can_train_save_and_load(self.FIXTURES_ROOT / 'biattentive_classification_network' / 'output_only_elmo_experiment.json')

tests/models/biattentive_classification_network_test.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
common/testing/model_test_case.py:92: in ensure_model_can_train_save_and_load
    self.check_model_computes_gradients_correctly(model, model_batch)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

model = BiattentiveClassificationNetwork(
  (_text_field_embedder): BasicTextFieldEmbedder(
    (token_embedder_tokens): Embed...   (_dropout): ModuleList(
      (0): Dropout(p=0.2)
      (1): Dropout(p=0.0)
    )
  )
  (loss): CrossEntropyLoss()
)
model_batch = {'label': tensor([ 0,  0,  0,  3,  0,  0,  0,  1,  0,  0,  0,  0,  0,  2,
         4,  0,  3,  1,  0,  1,  2]), 'token...   0,   0],
        [ 12,   9,  10,   0,   0],
        [ 11,   5,   6,   2,   0],
        [  7,   8,   3,   4,   2]])}}

    @staticmethod
    def check_model_computes_gradients_correctly(model, model_batch):
        model.zero_grad()
        result = model(**model_batch)
        result["loss"].backward()
        has_zero_or_none_grads = {}
        for name, parameter in model.named_parameters():
            zeros = torch.zeros(parameter.size())
            if parameter.requires_grad:

                if parameter.grad is None:
                    has_zero_or_none_grads[name] = "No gradient computed (i.e parameter.grad is None)"
                # Some parameters will only be partially updated,
                # like embeddings, so we just check that any gradient is non-zero.
                elif (parameter.grad.cpu() == zeros).all():
                    has_zero_or_none_grads[name] = f"zeros with shape ({tuple(parameter.grad.size())})"
            else:
                assert parameter.grad is None

        if has_zero_or_none_grads:
            for name, grad in has_zero_or_none_grads.items():
                print(f"Parameter: {name} had incorrect gradient: {grad}")
>           raise Exception("Incorrect gradients found. See stdout for more info.")
E           Exception: Incorrect gradients found. See stdout for more info.

common/testing/model_test_case.py:175: Exception
----------------------------- Captured stdout call -----------------------------
Parameter: _self_attentive_pooling_projection.bias had incorrect gradient: zeros with shape ((1,))
----------------------------- Captured stderr call -----------------------------
2018-10-24 12:30:15,664 - INFO - allennlp.common.checks - Pytorch version: 0.4.0
0it [00:00, ?it/s]2018-10-24 12:30:15,709 - INFO - allennlp.data.dataset_readers.stanford_sentiment_tree_bank - Reading instances from lines in file at: /anaconda3/lib/python3.6/site-packages/allennlp/tests/fixtures/data/sst.txt
21it [00:00, 14987.30it/s]
2018-10-24 12:30:15,711 - INFO - allennlp.data.vocabulary - Fitting token dictionary from dataset.
100%|██████████| 21/21 [00:00<00:00, 198379.24it/s]
2018-10-24 12:30:15,764 - INFO - allennlp.common.checks - Pytorch version: 0.4.0
2018-10-24 12:30:15,769 - INFO - allennlp.commands.train - Reading training data from tests/fixtures/data/sst.txt
0it [00:00, ?it/s]2018-10-24 12:30:15,770 - INFO - allennlp.data.dataset_readers.stanford_sentiment_tree_bank - Reading instances from lines in file at: tests/fixtures/data/sst.txt
21it [00:00, 11770.73it/s]
2018-10-24 12:30:15,772 - INFO - allennlp.commands.train - Reading validation data from tests/fixtures/data/sst.txt
0it [00:00, ?it/s]2018-10-24 12:30:15,773 - INFO - allennlp.data.dataset_readers.stanford_sentiment_tree_bank - Reading instances from lines in file at: tests/fixtures/data/sst.txt
21it [00:00, 11470.29it/s]
2018-10-24 12:30:15,775 - INFO - allennlp.commands.train - Creating a vocabulary using validation, train data.
2018-10-24 12:30:15,775 - INFO - allennlp.data.vocabulary - Fitting token dictionary from dataset.
42it [00:00, 222144.73it/s]
2018-10-24 12:30:15,781 - INFO - root - Initializing ELMo
2018-10-24 12:30:15,839 - INFO - allennlp.training.trainer - Beginning training.
2018-10-24 12:30:15,840 - INFO - allennlp.training.trainer - Epoch 0/0
2018-10-24 12:30:15,841 - INFO - allennlp.training.trainer - Peak CPU memory usage MB: 473.341952
  0%|          | 0/1 [00:00<?, ?it/s]2018-10-24 12:30:15,860 - INFO - allennlp.training.trainer - Training
accuracy: 0.4286, accuracy3: 0.7619, loss: 1.5575 ||: 100%|##########| 1/1 [00:00<00:00, 28.62it/s]
2018-10-24 12:30:15,896 - INFO - allennlp.training.trainer - Validating
accuracy: 0.1905, accuracy3: 0.8095, loss: 1.5748 ||: 100%|##########| 1/1 [00:00<00:00, 39.50it/s]
2018-10-24 12:30:15,928 - INFO - allennlp.training.trainer - Best validation performance so far. Copying weights to '/tmp/allennlp_tests/save_and_load_test/best.th'.
2018-10-24 12:30:15,934 - INFO - allennlp.training.trainer - Training loss : 1.557502    Validation loss : 1.574843
2018-10-24 12:30:15,936 - INFO - allennlp.training.trainer - Training accuracy : 0.428571    Validation accuracy : 0.190476
2018-10-24 12:30:15,937 - INFO - allennlp.training.trainer - Training accuracy3 : 0.761905    Validation accuracy3 : 0.809524
2018-10-24 12:30:15,938 - INFO - allennlp.training.trainer - Epoch duration: 00:00:00
2018-10-24 12:30:15,939 - INFO - allennlp.models.archival - archiving weights and vocabulary to /tmp/allennlp_tests/save_and_load_test/model.tar.gz
2018-10-24 12:30:15,994 - INFO - allennlp.commands.train - Loading the best epoch weights.
2018-10-24 12:30:16,002 - INFO - allennlp.commands.train - Metrics: {
  "training_duration": "00:00:00",
  "training_start_epoch": 0,
  "training_epochs": 1,
  "training_accuracy": 0.42857142857142855,
  "training_accuracy3": 0.7619047619047619,
  "training_loss": 1.5575016736984253,
  "validation_accuracy": 0.19047619047619047,
  "validation_accuracy3": 0.8095238095238095,
  "validation_loss": 1.5748430490493774,
  "best_validation_loss": 1.5748430490493774,
  "best_epoch": 0
}
2018-10-24 12:30:16,003 - INFO - allennlp.models.archival - loading archive file /tmp/allennlp_tests/save_and_load_test/model.tar.gz from cache at /tmp/allennlp_tests/save_and_load_test/model.tar.gz
2018-10-24 12:30:16,004 - INFO - allennlp.models.archival - extracting archive file /tmp/allennlp_tests/save_and_load_test/model.tar.gz to temp dir /var/folders/zf/ygx0nnwn5mxf8xfj6jmmcf7jxvszm2/T/tmp4po86tan
2018-10-24 12:30:16,088 - INFO - allennlp.data.vocabulary - Loading token dictionary from /var/folders/zf/ygx0nnwn5mxf8xfj6jmmcf7jxvszm2/T/tmp4po86tan/vocabulary.
2018-10-24 12:30:16,104 - INFO - root - Initializing ELMo
0it [00:00, ?it/s]2018-10-24 12:30:16,228 - INFO - allennlp.data.dataset_readers.stanford_sentiment_tree_bank - Reading instances from lines in file at: tests/fixtures/data/sst.txt
21it [00:00, 13573.80it/s]
2018-10-24 12:30:16,230 - WARNING - allennlp.data.iterators.bucket_iterator - shuffle parameter is set to False, while bucket iterators by definition change the order of your data.
0it [00:00, ?it/s]2018-10-24 12:30:16,232 - INFO - allennlp.data.dataset_readers.stanford_sentiment_tree_bank - Reading instances from lines in file at: tests/fixtures/data/sst.txt
21it [00:00, 18323.36it/s]
2018-10-24 12:30:16,234 - WARNING - allennlp.data.iterators.bucket_iterator - shuffle parameter is set to False, while bucket iterators by definition change the order of your data.
------------------------------ Captured log call -------------------------------
checks.py                   29 INFO     Pytorch version: 0.4.0
stanford_sentiment_tree_bank.py   70 INFO     Reading instances from lines in file at: /anaconda3/lib/python3.6/site-packages/allennlp/tests/fixtures/data/sst.txt
vocabulary.py              341 INFO     Fitting token dictionary from dataset.
checks.py                   29 INFO     Pytorch version: 0.4.0
train.py                   147 INFO     Reading training data from tests/fixtures/data/sst.txt
stanford_sentiment_tree_bank.py   70 INFO     Reading instances from lines in file at: tests/fixtures/data/sst.txt
train.py                   154 INFO     Reading validation data from tests/fixtures/data/sst.txt
stanford_sentiment_tree_bank.py   70 INFO     Reading instances from lines in file at: tests/fixtures/data/sst.txt
train.py                   269 INFO     Creating a vocabulary using validation, train data.
vocabulary.py              341 INFO     Fitting token dictionary from dataset.
elmo.py                     89 INFO     Initializing ELMo
trainer.py                 671 INFO     Beginning training.
trainer.py                 426 INFO     Epoch 0/0
trainer.py                 427 INFO     Peak CPU memory usage MB: 473.341952
trainer.py                 452 INFO     Training
trainer.py                 625 INFO     Validating
trainer.py                 793 INFO     Best validation performance so far. Copying weights to '/tmp/allennlp_tests/save_and_load_test/best.th'.
trainer.py                 615 INFO     Training loss : 1.557502    Validation loss : 1.574843
trainer.py                 615 INFO     Training accuracy : 0.428571    Validation accuracy : 0.190476
trainer.py                 615 INFO     Training accuracy3 : 0.761905    Validation accuracy3 : 0.809524
trainer.py                 714 INFO     Epoch duration: 00:00:00
archival.py                 71 INFO     archiving weights and vocabulary to /tmp/allennlp_tests/save_and_load_test/model.tar.gz
train.py                   308 INFO     Loading the best epoch weights.
train.py                   327 INFO     Metrics: {
  "training_duration": "00:00:00",
  "training_start_epoch": 0,
  "training_epochs": 1,
  "training_accuracy": 0.42857142857142855,
  "training_accuracy3": 0.7619047619047619,
  "training_loss": 1.5575016736984253,
  "validation_accuracy": 0.19047619047619047,
  "validation_accuracy3": 0.8095238095238095,
  "validation_loss": 1.5748430490493774,
  "best_validation_loss": 1.5748430490493774,
  "best_epoch": 0
}
archival.py                111 INFO     loading archive file /tmp/allennlp_tests/save_and_load_test/model.tar.gz from cache at /tmp/allennlp_tests/save_and_load_test/model.tar.gz
archival.py                119 INFO     extracting archive file /tmp/allennlp_tests/save_and_load_test/model.tar.gz to temp dir /var/folders/zf/ygx0nnwn5mxf8xfj6jmmcf7jxvszm2/T/tmp4po86tan
vocabulary.py              254 INFO     Loading token dictionary from /var/folders/zf/ygx0nnwn5mxf8xfj6jmmcf7jxvszm2/T/tmp4po86tan/vocabulary.
elmo.py                     89 INFO     Initializing ELMo
stanford_sentiment_tree_bank.py   70 INFO     Reading instances from lines in file at: tests/fixtures/data/sst.txt
bucket_iterator.py          92 WARNING  shuffle parameter is set to False, while bucket iterators by definition change the order of your data.
stanford_sentiment_tree_bank.py   70 INFO     Reading instances from lines in file at: tests/fixtures/data/sst.txt
bucket_iterator.py          92 WARNING  shuffle parameter is set to False, while bucket iterators by definition change the order of your data.
===Flaky Test Report===

test_evaluate_from_args passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_model_can_train_save_and_load passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_batch_predictions_are_consistent passed 1 out of the required 1 times. Success!
test_model_can_train_save_and_load passed 1 out of the required 1 times. Success!
test_elmo_no_features_can_train_save_and_load passed 1 out of the required 1 times. Success!

===End Flaky Test Report===
=============================== warnings summary ===============================
/anaconda3/lib/python3.6/site-packages/nbconvert/exporters/exporter_locator.py:28: DeprecationWarning: `nbconvert.exporters.exporter_locator` is deprecated in favor of `nbconvert.exporters.base` since nbconvert 5.0.
  DeprecationWarning)

/anaconda3/lib/python3.6/site-packages/tornado/web.py:1747: DeprecationWarning: @asynchronous is deprecated, use coroutines instead
  DeprecationWarning)

/anaconda3/lib/python3.6/site-packages/cookies.py:312: DeprecationWarning: Flags not at the start of the expression '(?ix)  # Case-insens' (truncated)
  ATTR_RE = re.compile(ATTR)

/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)

/anaconda3/lib/python3.6/site-packages/allennlp/data/fields/array_field.py:40: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  return_array[slices] = self.array

/anaconda3/lib/python3.6/site-packages/allennlp/data/fields/array_field.py:40: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  return_array[slices] = self.array

/anaconda3/lib/python3.6/site-packages/allennlp/data/fields/array_field.py:40: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  return_array[slices] = self.array

/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)

/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)

/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)

/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)
/anaconda3/lib/python3.6/site-packages/msgpack_numpy.py:184: PendingDeprecationWarning: encoding is deprecated, Use raw=False instead.
  return _unpackb(packed, **kwargs)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)
/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

/anaconda3/lib/python3.6/site-packages/werkzeug/local.py:347: DeprecationWarning: Request.is_xhr is deprecated. Given that the X-Requested-With header is not a part of any spec, it is not reliable
  return getattr(self._get_current_object(), name)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
 1 failed, 735 passed, 6 skipped, 10 deselected, 60 warnings in 263.85 seconds =
2018-10-24 12:33:46,193 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,195 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,197 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,198 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,199 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,200 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,202 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,203 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,205 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,206 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,207 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,208 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,209 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,209 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,210 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,211 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,212 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,213 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,214 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,231 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,234 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,237 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,239 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server
2018-10-24 12:33:46,241 - INFO - allennlp.training.metrics.wikitables_accuracy - Stopped SEMPRE server```
hzeng-otterai commented 5 years ago

I just got the same failure too on version 0.8.4. Also in conda (4.5.12) environment.

================================================================================================================= FAILURES =================================================================================================================
__________________________________________________________________________ BiattentiveClassificationNetworkTest.test_output_only_elmo_bcn_can_train_save_and_load __________________________________________________________________________

self = <allennlp.tests.models.biattentive_classification_network_test.BiattentiveClassificationNetworkTest testMethod=test_output_only_elmo_bcn_can_train_save_and_load>

    def test_output_only_elmo_bcn_can_train_save_and_load(self):
        # pylint: disable=line-too-long
>       self.ensure_model_can_train_save_and_load(self.FIXTURES_ROOT / 'biattentive_classification_network' / 'output_only_elmo_experiment.json')

allennlp/tests/models/biattentive_classification_network_test.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
allennlp/common/testing/model_test_case.py:106: in ensure_model_can_train_save_and_load
    self.check_model_computes_gradients_correctly(model, model_batch, gradients_to_ignore)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

model = BiattentiveClassificationNetwork(
  (_text_field_embedder): BasicTextFieldEmbedder(
    (token_embedder_tokens): Embed...
    (_dropout): ModuleList(
      (0): Dropout(p=0.2)
      (1): Dropout(p=0)
    )
  )
  (loss): CrossEntropyLoss()
)
model_batch = {'label': tensor([0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 4, 0, 3, 1, 0, 1, 2]), 'tokens': {'elmo': tensor([[[259,  ...     [ 5,  6,  2,  0,  0],
        [12,  9, 10,  0,  0],
        [11,  5,  6,  2,  0],
        [ 7,  8,  3,  4,  2]])}}
params_to_ignore = None

    @staticmethod
    def check_model_computes_gradients_correctly(model: Model,
                                                 model_batch: Dict[str, Union[Any, Dict[str, Any]]],
                                                 params_to_ignore: Set[str] = None):
        print("Checking gradients")
        model.zero_grad()
        result = model(**model_batch)
        result["loss"].backward()
        has_zero_or_none_grads = {}
        for name, parameter in model.named_parameters():
            zeros = torch.zeros(parameter.size())
            if params_to_ignore and name in params_to_ignore:
                continue
            if parameter.requires_grad:

                if parameter.grad is None:
                    has_zero_or_none_grads[name] = "No gradient computed (i.e parameter.grad is None)"

                elif parameter.grad.is_sparse or parameter.grad.data.is_sparse:
                    pass

                # Some parameters will only be partially updated,
                # like embeddings, so we just check that any gradient is non-zero.
                elif (parameter.grad.cpu() == zeros).all():
                    has_zero_or_none_grads[name] = f"zeros with shape ({tuple(parameter.grad.size())})"
            else:
                assert parameter.grad is None

        if has_zero_or_none_grads:
            for name, grad in has_zero_or_none_grads.items():
                print(f"Parameter: {name} had incorrect gradient: {grad}")
>           raise Exception("Incorrect gradients found. See stdout for more info.")
E           Exception: Incorrect gradients found. See stdout for more info.

allennlp/common/testing/model_test_case.py:198: Exception
----------------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------------
Checking gradients
Parameter: _self_attentive_pooling_projection.bias had incorrect gradient: zeros with shape ((1,))
----------------------------------------------------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------------------------------------------------
21it [00:00, 2953.54it/s]
100%|██████████| 21/21 [00:00<00:00, 131072.00it/s]
0it [00:00, ?it/s]
21it [00:00, 3728.11it/s]

0it [00:00, ?it/s]
21it [00:00, 5088.41it/s]

0it [00:00, ?it/s]
42it [00:00, 166346.33it/s]

  0%|          | 0/1 [00:00<?, ?it/s]
accuracy: 0.3333, accuracy3: 0.8095, loss: 1.4958 ||: 100%|##########| 1/1 [00:00<00:00, 17.00it/s]

  0%|          | 0/1 [00:00<?, ?it/s]
accuracy: 0.1905, accuracy3: 0.8095, loss: 1.5748 ||: 100%|##########| 1/1 [00:00<00:00, 28.18it/s]

21it [00:00, 3467.87it/s]
21it [00:00, 4044.65it/s]
abhisheksms commented 4 years ago

Surprising that you aren't allowed to use pip, even when you've installed it via conda. Regardless, I've been building conda binaries for the last couple allennlp releases (see https://anaconda.org/allennlp/allennlp).

You can install it (and all of its dependencies, like pytorch) with conda install allennlp -c pytorch -c allennlp -c conda-forge .

~As of right now, you also need conda install pytest to make it work, and if you additionally install responses and flaky (via conda install responses flaky) you can run allennlp test-install to verify that the setup is working. I've set up a PR to automatically bundle these dependencies (nelson-liu/allennlp-feedstock#5), so once that's been merged you won't need to install these additional packages.~

edit: you can just run the command above and then run allennlp test-install to verify that the package installed properly.

Hope that helps!

conda install allennlp -c pytorch -c allennlp -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - allennlp

Current channels:

  - https://conda.anaconda.org/pytorch/win-64
  - https://conda.anaconda.org/pytorch/noarch
  - https://conda.anaconda.org/allennlp/win-64
  - https://conda.anaconda.org/allennlp/noarch
  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

I am unable to install allennlp

sbiales commented 1 year ago

I am also unable to install allennlp from conda