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.

Error when running CS BART example

See original GitHub issue

I have been trying to run the cs example, but I keep getting the following error. I have looked upon BART’s documentation and GitHub page, but I couldn’t find much information about it. I am running this from inside a docker.

I am running in a docker with:

  • BART 0.7.0
  • Python 3.8
  • Ubuntu 18.04
  • No GPUs

my command:

python3.8 ./fastMRI/fastmri_examples/cs/run_bart.py \
    --challenge "singlecoil" \
    --data_path "data/FastMRI/knee/" \
    --out_path "pred-recons" \
    --reg_wt 0.01 \
    --mask_type "random" \
    --split val

If I try the advised steps

Once BART is installed, set the TOOLBOX_PATH environment variable and point PYTHONPATH to the python wrapper for BART:

export TOOLBOX_PATH=$(which bart) # here I have tried a bunch of different options like /usr/local/bin, /usr/local/bin/bart, etc
export PYTHONPATH=${TOOLBOX_PATH}/python:${PYTHONPATH}

BART still can’t be found via python even though I can call it from shell and I get:

Traceback (most recent call last):
  File "run_bart.py", line 15, in <module>
    import bart
ModuleNotFoundError: No module named 'bart'

My fix

I did manage to run the experiment by hardcoding the repository with sys.path.append inside run_bart.py

import sys
sys.path.append("./bart/python")      

What did I miss? I can probably fix this myself, but I am not aware of what exactly I missed.

EDIT: I forgot to mention that the correct argument for the script is out_path and not output_path as cited in the CS example README

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mmuckleycommented, Apr 7, 2021

I didn’t see any issues in PR #135 so I went ahead and merged it. If you find an issue feel free to open a new PR.

1reaction
mmuckleycommented, Apr 2, 2021

Yeah feel free to change both of them! I’ll comment over there when I get a chance to look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot load BART-base model · Issue #15248 - GitHub
The problem arises when using: the official example scripts: I'm using the example code for loading BART model with from_pretrained.
Read more >
Example 1: ESPIRiT reconstruction (R = 2x2)
The example uses ESPIRiT to obtain the image from 2x2 undersampled data. ... bart('caldir 20', und2x2); % Compute error map. proj = bart('pocsense...
Read more >
CS 537 Notes, Debugging - cs.wisc.edu
A debugger is a program that can control other programs. A programmer uses it to: Find bugs! Start up a program; Stop the...
Read more >
facebook/bart-base - Hugging Face
BART is a transformer encoder-decoder (seq2seq) model with a bidirectional ... bibsource = {dblp computer science bibliography, https://dblp.org} }.
Read more >
Error: «Could not load type MvcApplication» - Stack Overflow
They should correctly point to the class in its code behind. sample global.asax: <%@ Application Codebehind="Global.asax.cs" Inherits= ...
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