Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running totalsegmentator json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #430

Open
NathanMolinier opened this issue Feb 19, 2025 · 0 comments

Comments

@NathanMolinier
Copy link

NathanMolinier commented Feb 19, 2025

Description

I'm trying to run total segmentator MRI but run into an error:

If you use this tool please cite: https://pubs.rsna.org/doi/10.1148/ryai.230024

Traceback (most recent call last):
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/bin/TotalSegmentator", line 8, in <module>
    sys.exit(main())
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/site-packages/totalsegmentator/bin/TotalSegmentator.py", line 143, in main
    totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/site-packages/totalsegmentator/python_api.py", line 129, in totalsegmentator
    setup_totalseg()
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/site-packages/totalsegmentator/config.py", line 60, in setup_totalseg
    config = json.load(f)
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/GRAMES.POLYMTL.CA/p118739/.conda/envs/total_env/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Steps to reproduce

  • Create an environment with python 3.9 or 3.11 (I used conda)
  • conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.1 -c pytorch -c nvidia
  • pip install TotalSegmentator
  • TotalSegmentator -i $img -o segmentations --task total_mr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant