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.

FileNotFoundError with conll_output_filepath

See original GitHub issue

I’m trying to follow the steps from the README to run NeuroNER using the default parameters.ini settings. I’m running into a FileNotFoundError at train.py, line 95.

I’m new to python, but will try to track down the source of the issue. It looks like maybe the file should’ve been created by this line, but it’s not clear to me why.

This is on ubuntu 16.04, python 3.5.2. Any advice on how to debug this issue?

Here’s partial output from running python main.py:

Starting epoch 0
Training completed in 0.00 seconds
Evaluate model on the train set
Traceback (most recent call last):
  File "main.py", line 445, in <module>
    main()
  File "main.py", line 392, in main
    y_pred, y_true, output_filepaths = train.predict_labels(sess, model, transition_params_trained, parameters, dataset, epoch_number, stats_graph_folde$
, dataset_filepaths)
  File "/home/user/neuroner/neuroner/src/train.py", line 113, in predict_labels
    prediction_output = prediction_step(sess, dataset, dataset_type, model, transition_params_trained, stats_graph_folder, epoch_number, parameters, dat$
set_filepaths)
  File "/home/user/neuroner/neuroner/src/train.py", line 95, in prediction_step
    with open(conll_output_filepath, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '../output/en_2017-07-05_22-35-05-549137/000_train.txt_conll_evaluation.txt'

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
davidbentoncommented, Jul 8, 2017

This was a memory error. The perl script wasn’t able to complete because of insufficient memory, but os.system hides the error output. I increased the swapfile size and all’s well.

0reactions
nader2929commented, Nov 19, 2021

I am also running into the same issue however I am running POP_OS! which uses btfrs, so increasing the swapfile size is a bit problematic.

Formatting deploy set from BRAT to CONLL... Done.
Converting CONLL from BIO to BIOES format... Done.
Predict labels for the deploy set
Formatting 006_deploy set from CONLL to BRAT... Done.
Traceback (most recent call last):
  File "neuroner_starter_code.py", line 124, in <module>
    load_neuroner()    
  File "neuroner_starter_code.py", line 79, in load_neuroner
    nn.predict(fileTxt)
  File "/home/wdps/.local/lib/python3.7/site-packages/neuroner/neuromodel.py", line 813, in predict
    annotation_filepath, verbose=True)
  File "/home/wdps/.local/lib/python3.7/site-packages/neuroner/brat_to_conll.py", line 73, in get_entities_from_brat
    with codecs.open(text_filepath, 'r', 'UTF-8') as f:
  File "/usr/lib/python3.7/codecs.py", line 898, in open
    file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: './output/temp_2021-11-19_00-25-04-988634/brat/deploy/temp_00006.txt'

This is the stack trace, any guidance from anyone would be appreciated. Any more needed info let me know.

Thank you

So realised that some of my text files are empty which also causes this error. Adding a check for that got rid of the error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FileNotFoundError: [Errno 2] Stuck - python - Stack Overflow
1 Answer 1 ... the files os.walk() returns is not a list of paths to files it's a list of names (as strings)...
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
This error tells you that you are trying to access a file or folder that does not exist. To fix this error, check...
Read more >
[SOLVED] Python filenotfounderror - A Quick Guide - AskPython
It is a system message that the compiler throws when you are trying to execute a command that requires a file that 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