allenai / allennlp

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

Switch from `tensorboard` to `tensorboard-pytorch` dependency #835

Closed leo-liuzy closed 6 years ago

leo-liuzy commented 6 years ago

I tried to update the allennlp by using pip install --upgrade allennlp, but I received the error message like the following when I attempted to run python -m allennlp.run predict -h :

/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Traceback (most recent call last):
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/run.py", line 10, in <module>
    from allennlp.commands import main  # pylint: disable=wrong-import-position
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/commands/__init__.py", line 6, in <module>
    from allennlp.commands.serve import Serve
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/commands/serve.py", line 25, in <module>
    from allennlp.service import server_sanic
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/service/server_sanic.py", line 28, in <module>
    from allennlp.service.predictors import Predictor, DemoModel
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/service/predictors/__init__.py", line 9, in <module>
    from .predictor import Predictor, DemoModel
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/service/predictors/predictor.py", line 5, in <module>
    from allennlp.models import Model
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/models/__init__.py", line 7, in <module>
    from allennlp.models.crf_tagger import CrfTagger
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/models/crf_tagger.py", line 14, in <module>
    from allennlp.training.metrics import SpanBasedF1Measure
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/training/__init__.py", line 1, in <module>
    from allennlp.training.trainer import Trainer
  File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/allennlp/training/trainer.py", line 21, in <module>
    from tensorboard import SummaryWriter
ImportError: cannot import name 'SummaryWriter'

I thought I should use the --upgrade flag, so I reinstall the miniconda3 and allennlp. However, the error message is still printed out.

I execute those lines in CentOS 7 Linux run on a computing cluster's login node. I presume this should be an allennlp error ? Also, just curious, what is the correct way to update allennlp without pulling again from the git? (since this is unclear in the allennlp README)

matt-gardner commented 6 years ago

This is due to some issues with the tensorboard pip package. You need to install a particular version, and passing the --upgrade flag to pip will install a newer version that isn't compatible. pip install tensorboard==1.0.0a6 should fix your issue. See https://github.com/allenai/allennlp/issues/612#issuecomment-363590830.

matt-gardner commented 6 years ago

And if you want a newer version of allennlp, that hasn't been released yet, you need to give pip a particular git commit, or clone the repo and use that. --upgrade won't ever work to get you an unreleased version of allennlp - it will only get you a newer released version.

leo-liuzy commented 6 years ago

So, I ran the upgrade and pip install tensorboard==1.0.0a6, but the input looks different from predictor tutorial:

python -m allennlp.run predict --help

/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
usage: python -m allennlp.run [command] predict [-h]
                                                [--output-file OUTPUT_FILE]
                                                [--batch-size BATCH_SIZE]
                                                [--silent]
                                                [--cuda-device CUDA_DEVICE]
                                                [-o OVERRIDES]
                                                archive_file input_file

Run the specified model against a JSON-lines input file.

positional arguments:
  archive_file          the archived model to make predictions with
  input_file            path to input file

optional arguments:
  -h, --help            show this help message and exit
  --output-file OUTPUT_FILE
                        path to output file
  --batch-size BATCH_SIZE
                        The batch size to use for processing
  --silent              do not print output to stdout
  --cuda-device CUDA_DEVICE
                        id of GPU to use (if any)
  -o OVERRIDES, --overrides OVERRIDES
                        a HOCON structure used to override the experiment
                        configuration

There is no --include-package and --predictor flags.

matt-gardner commented 6 years ago

Those flags are in the current master, not in version 0.3. They will be included in the 0.4 release that's coming up in the next week or so. The tutorials are versioned, and you're looking at the tutorials for the master branch, not for the 0.3 release.

leo-liuzy commented 6 years ago

so I need to git pull the repository to install the 0.4 release, correct?

matt-gardner commented 6 years ago

You could also do pip install git://github.com/allenai/allennlp.git@7aa71af (or use whatever commit id you want at the end, isntead of the one I gave). That should work.

leo-liuzy commented 6 years ago

Yep, I git pull and install and it has the flag now. However, I fail some verification test. Should I be worried?

matt-gardner commented 6 years ago

You probably shouldn't be worried, but what tests fail?

leo-liuzy commented 6 years ago

I am not sure if this is an allennlp problem, but this is the output

tests/notebooks_test.py::TestNotebooks::test_data_pipeline_tutorial PASSED [  0%]
tests/notebooks_test.py::TestNotebooks::test_embedding_tokens_tutorial PASSED                       [  0%]
tests/notebooks_test.py::TestNotebooks::test_vocabulary_tutorial PASSED                             [  0%]
tests/commands/elmo_test.py::TestElmoCommand::test_all_embedding_works PASSED                       [  0%]
tests/commands/elmo_test.py::TestElmoCommand::test_average_embedding_works PASSED                   [  1%]
tests/commands/elmo_test.py::TestElmoCommand::test_batch_embedding_works PASSED                     [  1%]
tests/commands/elmo_test.py::TestElmoCommand::test_duplicate_sentences PASSED                       [  1%]
tests/commands/elmo_test.py::TestElmoCommand::test_top_embedding_works PASSED                       [  1%]
tests/commands/elmo_test.py::TestElmoEmbedder::test_embeddings_are_as_expected PASSED               [  1%]
tests/commands/evaluate_test.py::TestEvaluate::test_evaluate_from_args PASSED                       [  2%]
tests/commands/evaluate_test.py::TestEvaluate::test_external_modules FAILED                         [  2%]
tests/commands/main_test.py::TestMain::test_fails_on_unknown_command PASSED                         [  2%]
tests/commands/main_test.py::TestMain::test_subcommand_overrides PASSED                             [  2%]
tests/commands/main_test.py::TestMain::test_warn_on_deprecated_flags FAILED                         [  3%]
tests/commands/make_vocab_test.py::TestMakeVocab::test_make_vocab_fails_without_vocabulary_key PASSED [  3%]
tests/commands/make_vocab_test.py::TestMakeVocab::test_make_vocab_makes_vocab FAILED                [  3%]
tests/commands/predict_test.py::TestPredict::test_add_predict_subparser PASSED                      [  3%]
tests/commands/predict_test.py::TestPredict::test_alternative_file_formats PASSED                   [  3%]
tests/commands/predict_test.py::TestPredict::test_batch_prediction_works_with_known_model PASSED    [  4%]
tests/commands/predict_test.py::TestPredict::test_can_override_predictors PASSED                    [  4%]
tests/commands/predict_test.py::TestPredict::test_can_specify_predictor PASSED                      [  4%]
tests/commands/predict_test.py::TestPredict::test_fails_without_required_args PASSED                [  4%]
tests/commands/predict_test.py::TestPredict::test_other_modules PASSED                              [  4%]
tests/commands/predict_test.py::TestPredict::test_works_with_known_model PASSED                     [  5%]
tests/commands/serve_test.py::TestServe::test_add_serve PASSED                                      [  5%]
tests/commands/train_test.py::TestTrain::test_other_modules FAILED                                  [  5%]
tests/commands/train_test.py::TestTrain::test_train_args PASSED                                     [  5%]
tests/commands/train_test.py::TestTrain::test_train_model FAILED                                    [  6%]
tests/commands/train_test.py::TestTrain::test_train_with_test_set FAILED                            [  6%]
tests/commands/train_test.py::TestTrainOnLazyDataset::test_train_model FAILED                       [  6%]
tests/commands/train_test.py::TestTrainOnLazyDataset::test_train_with_test_set FAILED               [  6%]
tests/common/file_utils_test.py::TestFileUtils::test_cached_path FAILED                             [  6%]
tests/common/file_utils_test.py::TestFileUtils::test_get_from_cache FAILED                          [  7%]
tests/common/file_utils_test.py::TestFileUtils::test_url_to_filename PASSED                         [  7%]
tests/common/file_utils_test.py::TestFileUtils::test_url_to_filename_with_etags PASSED              [  7%]
tests/common/file_utils_test.py::TestFileUtils::test_url_to_filename_with_etags_eliminates_quotes PASSED [  7%]
tests/common/params_test.py::TestParams::test_add_file_to_archive PASSED                            [  8%]
tests/common/params_test.py::TestParams::test_as_flat_dict PASSED                                   [  8%]
tests/common/params_test.py::TestParams::test_load_from_file PASSED                                 [  8%]
tests/common/params_test.py::TestParams::test_overrides PASSED                                      [  8%]
tests/common/registrable_test.py::TestRegistrable::test_registrable_functionality_works PASSED      [  8%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_dataset_readers PASSED [  9%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_initializers PASSED    [  9%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_iterators PASSED       [  9%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_learning_rate_schedulers PASSED [  9%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_regularizers PASSED    [  9%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_seq2seq_encoders PASSED [ 10%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_seq2vec_encoders PASSED [ 10%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_similarity_functions PASSED [ 10%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_text_field_embedders PASSED [ 10%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_token_embedders PASSED [ 11%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_token_indexers PASSED  [ 11%]
tests/common/registrable_test.py::TestRegistrable::test_registry_has_builtin_tokenizers PASSED      [ 11%]
tests/common/test_util.py::TestCommonUtils::test_group_by_count PASSED                              [ 11%]
tests/common/test_util.py::TestCommonUtils::test_import_submodules PASSED                           [ 11%]
tests/common/test_util.py::TestCommonUtils::test_lazy_groups_of PASSED                              [ 12%]
tests/common/test_util.py::TestCommonUtils::test_namespace_match PASSED                             [ 12%]
tests/common/test_util.py::TestCommonUtils::test_pad_sequence_to_length PASSED                      [ 12%]
tests/common/test_util.py::TestCommonUtils::test_sanitize PASSED                                    [ 12%]
tests/custom_extensions/alternating_highway_lstm_test.py::TestCustomHighwayLSTM::test_large_model SKIPPED [ 12%]
tests/custom_extensions/alternating_highway_lstm_test.py::TestCustomHighwayLSTM::test_small_model SKIPPED [ 13%]
tests/custom_extensions/alternating_highway_lstm_test.py::TestCustomHighwayLSTM::test_validation_forward_pass_is_deterministic_in_model_with_dropout SKIPPED [ 13%]
tests/data/dataset_test.py::TestDataset::test_as_tensor_dict PASSED                                 [ 13%]
tests/data/dataset_test.py::TestDataset::test_instances_must_have_homogeneous_fields PASSED         [ 13%]
tests/data/dataset_test.py::TestDataset::test_padding_lengths_uses_max_instance_lengths PASSED      [ 14%]
tests/data/vocabulary_test.py::TestVocabulary::test_add_word_to_index_gives_consistent_results PASSED [ 14%]
tests/data/vocabulary_test.py::TestVocabulary::test_from_dataset_respects_exclusive_embedding_file FAILED [ 14%]
tests/data/vocabulary_test.py::TestVocabulary::test_from_dataset_respects_inclusive_embedding_file FAILED [ 14%]
tests/data/vocabulary_test.py::TestVocabulary::test_from_dataset_respects_min_count FAILED          [ 14%]
tests/data/vocabulary_test.py::TestVocabulary::test_from_params FAILED                              [ 15%]
tests/data/vocabulary_test.py::TestVocabulary::test_namespace_dependent_default_dict PASSED         [ 15%]
tests/data/vocabulary_test.py::TestVocabulary::test_namespaces PASSED                               [ 15%]
tests/data/vocabulary_test.py::TestVocabulary::test_saving_and_loading PASSED                       [ 15%]
tests/data/vocabulary_test.py::TestVocabulary::test_saving_and_loading_works_with_byte_encoding FAILED [ 16%]
tests/data/vocabulary_test.py::TestVocabulary::test_set_from_file_reads_non_padded_files PASSED     [ 16%]
tests/data/vocabulary_test.py::TestVocabulary::test_set_from_file_reads_padded_files PASSED         [ 16%]
tests/data/vocabulary_test.py::TestVocabulary::test_unknown_token PASSED                            [ 16%]
tests/data/dataset_readers/coref_reader_test.py::TestCorefReader::test_read_from_file[True] PASSED  [ 16%]
tests/data/dataset_readers/coref_reader_test.py::TestCorefReader::test_read_from_file[False] FAILED [ 17%]
tests/data/dataset_readers/language_modeling_dataset_test.py::TestLanguageModelingDatasetReader::test_read_from_file[True] FAILED [ 17%]
tests/data/dataset_readers/language_modeling_dataset_test.py::TestLanguageModelingDatasetReader::test_read_from_file[False] FAILED [ 17%]
tests/data/dataset_readers/lazy_dataset_reader_test.py::TestLazyDatasetReader::test_lazy PASSED     [ 17%]
tests/data/dataset_readers/lazy_dataset_reader_test.py::TestLazyDatasetReader::test_non_lazy FAILED [ 17%]
tests/data/dataset_readers/penn_tree_bank_reader_test.py::TestPennTreeBankConstituencySpanReader::test_get_gold_spans_correctly_extracts_spans PASSED [ 18%]
tests/data/dataset_readers/penn_tree_bank_reader_test.py::TestPennTreeBankConstituencySpanReader::test_read_from_file FAILED [ 18%]
tests/data/dataset_readers/seq2seq_test.py::TestSeq2SeqDatasetReader::test_default_format[True] PASSED [ 18%]
tests/data/dataset_readers/seq2seq_test.py::TestSeq2SeqDatasetReader::test_default_format[False] FAILED [ 18%]
tests/data/dataset_readers/seq2seq_test.py::TestSeq2SeqDatasetReader::test_source_add_start_token FAILED [ 19%]
tests/data/dataset_readers/sequence_tagging_test.py::TestSequenceTaggingDatasetReader::test_default_format[True] PASSED [ 19%]
tests/data/dataset_readers/sequence_tagging_test.py::TestSequenceTaggingDatasetReader::test_default_format[False] FAILED [ 19%]
tests/data/dataset_readers/sequence_tagging_test.py::TestSequenceTaggingDatasetReader::test_brown_corpus_format FAILED [ 19%]
tests/data/dataset_readers/snli_reader_test.py::TestSnliReader::test_read_from_file[True] PASSED    [ 19%]
tests/data/dataset_readers/snli_reader_test.py::TestSnliReader::test_read_from_file[False] FAILED   [ 20%]
tests/data/dataset_readers/srl_dataset_reader_test.py::TestSrlReader::test_read_from_file[True] PASSED [ 20%]
tests/data/dataset_readers/srl_dataset_reader_test.py::TestSrlReader::test_read_from_file[False] FAILED [ 20%]
tests/data/dataset_readers/srl_dataset_reader_test.py::TestSrlReader::test_srl_reader_can_filter_by_domain FAILED [ 20%]
tests/data/dataset_readers/dataset_utils/ontonotes_test.py::TestOntonotes::test_dataset_iterator PASSED [ 20%]
tests/data/dataset_readers/dataset_utils/ontonotes_test.py::TestOntonotes::test_dataset_path_iterator PASSED [ 21%]
tests/data/dataset_readers/dataset_utils/ontonotes_test.py::TestOntonotes::test_ontonotes_can_read_conll_file_with_multiple_documents PASSED [ 21%]
tests/data/dataset_readers/dataset_utils/span_utils_test.py::SpanUtilsTest::test_bio_tags_to_spans_extracts_correct_spans PASSED [ 21%]
tests/data/dataset_readers/dataset_utils/span_utils_test.py::SpanUtilsTest::test_bio_tags_to_spans_ignores_specified_tags PASSED [ 21%]
tests/data/dataset_readers/dataset_utils/span_utils_test.py::SpanUtilsTest::test_enumerate_spans_enumerates_all_spans PASSED [ 22%]
tests/data/dataset_readers/reading_comprehension/squad_test.py::TestSquadReader::test_read_from_file[True] PASSED [ 22%]
tests/data/dataset_readers/reading_comprehension/squad_test.py::TestSquadReader::test_read_from_file[False] FAILED [ 22%]
tests/data/dataset_readers/reading_comprehension/squad_test.py::TestSquadReader::test_can_build_from_params PASSED [ 22%]
tests/data/dataset_readers/reading_comprehension/triviaqa_test.py::TestTriviaQaReader::test_read[True] PASSED [ 22%]
tests/data/dataset_readers/reading_comprehension/triviaqa_test.py::TestTriviaQaReader::test_read[False] FAILED [ 23%]
tests/data/dataset_readers/reading_comprehension/util_test.py::TestReadingComprehensionUtil::test_char_span_to_token_span_handles_easy_cases PASSED [ 23%]
tests/data/dataset_readers/reading_comprehension/util_test.py::TestReadingComprehensionUtil::test_char_span_to_token_span_handles_hard_cases PASSED [ 23%]
tests/data/fields/array_field_test.py::TestArrayField::test_as_tensor_handles_larger_padding_dimensions PASSED [ 23%]
tests/data/fields/array_field_test.py::TestArrayField::test_get_padding_lengths_correctly_returns_ordered_shape PASSED [ 24%]
tests/data/fields/array_field_test.py::TestArrayField::test_padding_handles_list_fields PASSED      [ 24%]
tests/data/fields/array_field_test.py::TestArrayField::test_padding_handles_list_fields_with_padding_values PASSED [ 24%]
tests/data/fields/index_field_test.py::TestIndexField::test_as_tensor_converts_field_correctly PASSED [ 24%]
tests/data/fields/index_field_test.py::TestIndexField::test_index_field_empty_field_works PASSED    [ 24%]
tests/data/fields/index_field_test.py::TestIndexField::test_index_field_raises_on_incorrect_label_type PASSED [ 25%]
tests/data/fields/label_field_test.py::TestLabelField::test_as_tensor_returns_integer_tensor PASSED [ 25%]
tests/data/fields/label_field_test.py::TestLabelField::test_class_variables_for_namespace_warnings_work_correctly PASSED [ 25%]
tests/data/fields/label_field_test.py::TestLabelField::test_label_field_can_index_with_vocab PASSED [ 25%]
tests/data/fields/label_field_test.py::TestLabelField::test_label_field_empty_field_works PASSED    [ 25%]
tests/data/fields/label_field_test.py::TestLabelField::test_label_field_raises_with_incorrect_label_type PASSED [ 26%]
tests/data/fields/label_field_test.py::TestLabelField::test_label_field_raises_with_non_integer_labels_and_no_indexing PASSED [ 26%]
tests/data/fields/list_field_test.py::TestListField::test_all_fields_padded_to_max_length PASSED    [ 26%]
tests/data/fields/list_field_test.py::TestListField::test_as_tensor_can_handle_multiple_token_indexers PASSED [ 26%]
tests/data/fields/list_field_test.py::TestListField::test_as_tensor_can_handle_multiple_token_indexers_and_empty_fields PASSED [ 27%]
tests/data/fields/list_field_test.py::TestListField::test_fields_can_pad_to_greater_than_max_length PASSED [ 27%]
tests/data/fields/list_field_test.py::TestListField::test_get_padding_lengths PASSED                [ 27%]
tests/data/fields/list_field_test.py::TestListField::test_list_field_can_handle_empty_index_fields PASSED [ 27%]
tests/data/fields/list_field_test.py::TestListField::test_list_field_can_handle_empty_sequence_label_fields PASSED [ 27%]
tests/data/fields/list_field_test.py::TestListField::test_list_field_can_handle_empty_text_fields PASSED [ 28%]
tests/data/fields/list_field_test.py::TestListField::test_nested_list_fields_are_padded_correctly PASSED [ 28%]
tests/data/fields/sequence_label_field_test.py::TestSequenceLabelField::test_as_tensor_produces_integer_targets PASSED [ 28%]
tests/data/fields/sequence_label_field_test.py::TestSequenceLabelField::test_class_variables_for_namespace_warnings_work_correctly PASSED [ 28%]
tests/data/fields/sequence_label_field_test.py::TestSequenceLabelField::test_count_vocab_items_correctly_indexes_tags PASSED [ 29%]
tests/data/fields/sequence_label_field_test.py::TestSequenceLabelField::test_index_converts_field_correctly PASSED [ 29%]
tests/data/fields/sequence_label_field_test.py::TestSequenceLabelField::test_sequence_label_field_raises_on_incorrect_type PASSED [ 29%]
tests/data/fields/sequence_label_field_test.py::TestSequenceLabelField::test_tag_length_mismatch_raises PASSED [ 29%]
tests/data/fields/span_field_test.py::TestSpanField::test_as_tensor_converts_span_field_correctly PASSED [ 29%]
tests/data/fields/span_field_test.py::TestSpanField::test_empty_span_field_works PASSED             [ 30%]
tests/data/fields/span_field_test.py::TestSpanField::test_span_field_raises_if_span_end_is_greater_than_sentence_length PASSED [ 30%]
tests/data/fields/span_field_test.py::TestSpanField::test_span_field_raises_on_ill_defined_span PASSED [ 30%]
tests/data/fields/span_field_test.py::TestSpanField::test_span_field_raises_on_incorrect_label_type PASSED [ 30%]
tests/data/fields/text_field_test.py::TestTextField::test_as_tensor_handles_characters PASSED       [ 30%]
tests/data/fields/text_field_test.py::TestTextField::test_as_tensor_handles_longer_lengths PASSED   [ 31%]
tests/data/fields/text_field_test.py::TestTextField::test_as_tensor_handles_words PASSED            [ 31%]
tests/data/fields/text_field_test.py::TestTextField::test_as_tensor_handles_words_and_characters_with_longer_lengths PASSED [ 31%]
tests/data/fields/text_field_test.py::TestTextField::test_field_counts_vocab_items_correctly PASSED [ 31%]
tests/data/fields/text_field_test.py::TestTextField::test_get_padding_lengths_raises_if_no_indexed_tokens PASSED [ 32%]
tests/data/fields/text_field_test.py::TestTextField::test_index_converts_field_correctly PASSED     [ 32%]
tests/data/fields/text_field_test.py::TestTextField::test_padding_lengths_are_computed_correctly PASSED [ 32%]
tests/data/iterators/adaptive_iterator_test.py::TestAdaptiveIterator::test_biggest_batch_first_passes_off_to_bucket_iterator PASSED [ 32%]
tests/data/iterators/adaptive_iterator_test.py::TestAdaptiveIterator::test_create_batches_groups_correctly PASSED [ 32%]
tests/data/iterators/adaptive_iterator_test.py::TestAdaptiveIterator::test_create_batches_respects_maximum_batch_size PASSED [ 33%]
tests/data/iterators/adaptive_iterator_test.py::TestAdaptiveIterator::test_from_params PASSED       [ 33%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_call_iterates_over_data_forever PASSED [ 33%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_create_batches_groups_correctly PASSED [ 33%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_few_instances_per_epoch PASSED [ 33%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_from_params PASSED             [ 34%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_get_num_batches PASSED         [ 34%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_many_instances_per_epoch PASSED [ 34%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_max_instances_in_memory PASSED [ 34%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_multiple_cursors PASSED        [ 35%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_shuffle PASSED                 [ 35%]
tests/data/iterators/basic_iterator_test.py::TestBasicIterator::test_yield_one_epoch_iterates_over_the_data_once PASSED [ 35%]
tests/data/iterators/bucket_iterator_test.py::TestBucketIterator::test_biggest_batch_first_works PASSED [ 35%]
tests/data/iterators/bucket_iterator_test.py::TestBucketIterator::test_create_batches_groups_correctly PASSED [ 35%]
tests/data/iterators/bucket_iterator_test.py::TestBucketIterator::test_create_batches_groups_correctly_with_max_instances PASSED [ 36%]
tests/data/iterators/bucket_iterator_test.py::TestBucketIterator::test_from_params PASSED           [ 36%]
tests/data/token_indexers/character_token_indexer_test.py::CharacterTokenIndexerTest::test_as_array_produces_token_sequence PASSED [ 36%]
tests/data/token_indexers/character_token_indexer_test.py::CharacterTokenIndexerTest::test_count_vocab_items_respects_casing PASSED [ 36%]
tests/data/token_indexers/character_token_indexer_test.py::CharacterTokenIndexerTest::test_token_to_indices_produces_correct_characters PASSED [ 37%]
tests/data/token_indexers/dep_label_indexer_test.py::TestDepLabelIndexer::test_as_array_produces_token_sequence 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/main.py", line 100, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/main.py", line 138, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/main.py", line 161, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/flaky/flaky_pytest_plugin.py", line 81, in pytest_runtest_protocol
INTERNALERROR>     self.runner.pytest_runtest_protocol(item, nextitem)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/runner.py", line 62, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/runner.py", line 79, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/flaky/flaky_pytest_plugin.py", line 120, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 196, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/skipping.py", line 227, in pytest_runtest_makereport
INTERNALERROR>     rep = outcome.get_result()
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/runner.py", line 304, in pytest_runtest_makereport
INTERNALERROR>     longrepr = item.repr_failure(excinfo)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/python.py", line 598, in repr_failure
INTERNALERROR>     return self._repr_failure_py(excinfo, style=style)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/python.py", line 591, in _repr_failure_py
INTERNALERROR>     style=style)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/nodes.py", line 287, in _repr_failure_py
INTERNALERROR>     style=style, tbfilter=tbfilter)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/_code/code.py", line 435, in getrepr
INTERNALERROR>     return fmt.repr_excinfo(self)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/_code/code.py", line 669, in repr_excinfo
INTERNALERROR>     reprtraceback = self.repr_traceback(excinfo)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/_code/code.py", line 621, in repr_traceback
INTERNALERROR>     reprentry = self.repr_traceback_entry(entry, einfo)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/_code/code.py", line 580, in repr_traceback_entry
INTERNALERROR>     reprargs = self.repr_args(entry) if not short else None
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/_code/code.py", line 503, in repr_args
INTERNALERROR>     args.append((argname, self._saferepr(argvalue)))
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/_pytest/_code/code.py", line 497, in _saferepr
INTERNALERROR>     return py.io.saferepr(obj)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/py/_io/saferepr.py", line 71, in saferepr
INTERNALERROR>     return srepr.repr(obj)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/py/_io/saferepr.py", line 13, in repr
INTERNALERROR>     return self._callhelper(reprlib.Repr.repr, self, x)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/py/_io/saferepr.py", line 38, in _callhelper
INTERNALERROR>     s = call(x, *args)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/reprlib.py", line 55, in repr
INTERNALERROR>     return self.repr1(x, self.maxlevel)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/reprlib.py", line 65, in repr1
INTERNALERROR>     return self.repr_instance(x, level)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/py/_io/saferepr.py", line 33, in repr_instance
INTERNALERROR>     return self._callhelper(builtin_repr, x)
INTERNALERROR>   File "/usr/lusers/zeyuliu2/miniconda3/lib/python3.6/site-packages/py/_io/saferepr.py", line 38, in _callhelper
INTERNALERROR>     s = call(x, *args)
INTERNALERROR> MemoryError

============================ 29 failed, 139 passed, 3 skipped in 58.88 seconds ============================
matt-gardner commented 6 years ago

Hmm, I've never seen that one, but it looks like your machine doesn't have enough RAM. I'm not sure how much RAM our tests take, but I would be concerned that you might not have enough RAM to train any significant model if you're getting a memory error just running the tests.

leo-liuzy commented 6 years ago

I see, thank you!

leo-liuzy commented 6 years ago

Um, I am still about how to get my own package recognized by python -m allnenlp.run ...

joelgrus commented 6 years ago

if you are using the 0.3.0 pip release, you have to make your own copy of allennlp/run.py

https://github.com/allenai/allennlp/blob/v0.3.0/allennlp/run.py

import your packages in that file, and use that as your entry point. See:

https://github.com/allenai/allennlp/blob/v0.3.0/tutorials/getting_started/creating_a_model.md#putting-it-all-together

--

(in the newest version there's just a command line flag to include extra packages, but that hasn't been released on pip yet.)

danyaljj commented 6 years ago

I have the same issue mentioned in the beginning: ImportError: cannot import name 'SummaryWriter' (installed version 3 of allennlp with pip).

Based on what Matt mentioned https://github.com/allenai/allennlp/issues/835#issuecomment-365312489 it's tensorboard's version that is creating problems. (As mentioned in #866 I had problems installing the recommended version). I followed the conversation and didn't find a clear conclusion as to what is the solution. Any advice on this, highly appreciated.

Side note: I am still trying to figure how Joel's https://github.com/allenai/allennlp/issues/835#issuecomment-365624606 fits in the picture :-)

matt-gardner commented 6 years ago

Joel's comment above was answering a different question. It looks to me like the right thing to do is what @nelson-liu suggested (https://github.com/allenai/allennlp/issues/762#issuecomment-365459357), switching to tensorboard-pytorch. @danyaljj or @nelson-liu, are either of you open to try switching out the dependency (and whatever necessary imports we have) and seeing if this works? We'd get to this eventually ourselves, but it'd go faster if we had some help.

nelson-liu commented 6 years ago

Sure, I can try to do it. To be clear: the chief purpose of the original tensorboard dependency was to just use the SummaryWriter -- the fact that it included the tensorboard application was just a bonus?

matt-gardner commented 6 years ago

Yes, I'm pretty sure that's true. @DeNeutoy, @matt-peters, you agree?

matt-peters commented 6 years ago

Sounds fine with me as long as whatever library we do use has an easy way to view the resulting log files.

matt-gardner commented 6 years ago

@nelson-liu, the idea is that you'll install tensorboard yourself, however you want to, and our requiring of tensorboard-pytorch won't conflict with that. Right?

nelson-liu commented 6 years ago

Yes! I don't think it makes sense to have tensorflow / tensorboard as a dependency of allennlp.

schmmd commented 6 years ago

This was in the 0.4 release. Thanks @nelson-liu !