question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem generating predictions

See original GitHub issue

Hi, Thank for resolving the previous issues, but I’m still having some problems generating predictions despite following the exact instructions in the ReadME.

After successfully installing SciREX, I followed the 4 training instructions:

    Extract the dataset files in folder tar -xvzf scirex_dataset/release_data.tar.gz --directory scirex_dataset
    Export path to scibert export BERT_BASE_FOLDER=<path-to-scibert> . This path should contain two files atleast - vocab.txt and weights.tar.gz. Download the file here https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/pytorch_models/scibert_scivocab_uncased.tar and untar it.
    Run CUDA_DEVICE=<cuda-device-num> bash scirex/commands/train_scirex_model.sh main to train main scirex model
    Run CUDA_DEVICE=<cuda-device-num> bash scirex/commands/train_pairwise_coreference.sh main to train secondary coreference model.

However, when I tried to follow the instructions to generate the predictions

scirex_archive=outputs/pwc_outputs/experiment_scirex_full/main \
scirex_coreference_archive=outputs/pwc_outputs/experiment_pairwise_coreference/main \
cuda_device=<cuda-device-num> \
bash scirex/commands/predict_scirex_model.sh

I got an error saying that the pwc_outputs/experiment_pairwise_coreference/main doesn’t exist. I check the directory and find that instead of experiment_pairwise_coreference, there is experiment_coreference, so I change the second line of the prediction instruction to scirex_coreference_archive=outputs/pwc_outputs/experiment_coreference/main and I get the following error:

ModuleNotFoundError: No module named 'scirex'
Predicting Salient Clustering
Traceback (most recent call last):
  File "scirex/predictors/predict_salient_clusters.py", line 25, in <module>
    predict(sys.argv[1], sys.argv[2], sys.argv[3])
  File "scirex/predictors/predict_salient_clusters.py", line 5, in predict
    clusters = [json.loads(line) for line in open(clusters_file)]
FileNotFoundError: [Errno 2] No such file or directory: 'test_outputs//cluster_predictions.jsonl'
Predicitng Salient Clusters using gold clusters as filter
Traceback (most recent call last):
  File "scirex/predictors/predict_salient_clusters_using_gold.py", line 11, in <module>
    from scirex.predictors.utils import *
ModuleNotFoundError: No module named 'scirex'
Predicting Relations End-to-End
Traceback (most recent call last):
  File "scirex/predictors/predict_n_ary_relations.py", line 16, in <module>
    from scirex.predictors.utils import merge_method_subrelations
ModuleNotFoundError: No module named 'scirex'
Predicting relations End-to-End with gold cluster filtering
Traceback (most recent call last):
  File "scirex/predictors/predict_n_ary_relations.py", line 16, in <module>
    from scirex.predictors.utils import merge_method_subrelations
ModuleNotFoundError: No module named 'scirex'
Predicting Relations on gold clusters
Traceback (most recent call last):
  File "scirex/predictors/predict_n_ary_relations.py", line 16, in <module>
    from scirex.predictors.utils import merge_method_subrelations
ModuleNotFoundError: No module named 'scirex'
Evaluating on all Predicted steps
Traceback (most recent call last):
  File "scirex/evaluation_scripts/scirex_relation_evaluate.py", line 7, in <module>
    from scirex.metrics.clustering_metrics import match_predicted_clusters_to_gold
ModuleNotFoundError: No module named 'scirex'
Evaluating on all predicted steps with filtering using gold salient clusters
Traceback (most recent call last):
  File "scirex/evaluation_scripts/scirex_relation_evaluate.py", line 7, in <module>
    from scirex.metrics.clustering_metrics import match_predicted_clusters_to_gold
ModuleNotFoundError: No module named 'scirex'

Any idea how I can fix this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
successarcommented, Sep 17, 2020

Hi

Is this the full error message ? Is the problem occurring after the first command in this file ? https://github.com/allenai/SciREX/blob/master/scirex/commands/predict_scirex_model.sh

Can you try creating a directory called “test_outputs” before running the prediction command ?

0reactions
Yichabodcommented, Sep 17, 2020

OK I created a test_output directory and it seemed to work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Hypotheses and Predictions - Academic Skills
Hypotheses and predictions are different components of the scientific method. The scientific method is a systematic process that helps minimize bias in ...
Read more >
Predicting - Reading Strategies & Misconceptions
Making predictions encourages readers to use critical thinking and problem solving skills. Readers are given the opportunity to reflect and evaluate the ...
Read more >
How to Choose the Right Forecasting Technique
Regression analysis and statistical forecasts are sometimes used in this way—that is, to estimate what will happen if no significant changes are made....
Read more >
How autism may stem from problems with prediction
People with autism do just fine with many of them. Some researchers are skeptical that problems of prediction are the root cause of...
Read more >
Theory of Mind: A Neural Prediction Problem - PMC - NCBI
The problem is exacerbated because these brain regions, ... These expectations can generate predictions for sequences of movements on the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found