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.

Bug in colab notebook, TorchIO Getting Started tutorial

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Bug summary

In the TorchIO Getting Started tutorial (https://colab.research.google.com/github/fepegar/torchio-notebooks/blob/main/notebooks/TorchIO_tutorial.ipynb), I noticed a bug which seems due to the version of TorchIO.

Switching from TorchIO version: 0.18.57

to TorchIO version: 0.18.76, it fixed the issue

Code for reproduction

In ## Training a network ### Whole images section

one_batch = next(iter(training_loader))

Actual outcome

A FileNotFoundError is produced

Error messages

FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
    return self.collate_fn(data)
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/collate.py", line 157, in default_collate
    return elem_type({key: default_collate([d[key] for d in batch]) for key in elem})
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/collate.py", line 157, in <dictcomp>
    return elem_type({key: default_collate([d[key] for d in batch]) for key in elem})
  File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/collate.py", line 157, in default_collate
    return elem_type({key: default_collate([d[key] for d in batch]) for key in elem})
  File "/usr/local/lib/python3.7/dist-packages/torchio/data/image.py", line 641, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/torchio/data/image.py", line 156, in __init__
    self.path = self._parse_path(path)
  File "/usr/local/lib/python3.7/dist-packages/torchio/data/image.py", line 419, in _parse_path
    return [self._parse_single_path(p) for p in path]
  File "/usr/local/lib/python3.7/dist-packages/torchio/data/image.py", line 419, in <listcomp>
    return [self._parse_single_path(p) for p in path]
  File "/usr/local/lib/python3.7/dist-packages/torchio/data/image.py", line 409, in _parse_single_path
    raise FileNotFoundError(f'File not found: "{path}"')
FileNotFoundError: File not found: "data"

Expected outcome

one batch loaded

System info

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AyedSamycommented, May 15, 2022

It works perfect thanks for the update! 😁

0reactions
allcontributors[bot]commented, May 15, 2022

@fepegar

I’ve put up a pull request to add @AyedSamy! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug in colab notebook, TorchIO Getting Started tutorial
Hi, @AyedSamy. Thanks for reporting. I'm trying to reproduce, but for some weird reason, I can't run the notebook. It says /bin/bash: pip:...
Read more >
Colab notebook contains incorrect link to data #775 - GitHub
In notebook Data preprocessing and augmentation using TorchIO - a tutorial.ipynb the link to download the fpg data is not specified correctly.
Read more >
TorchIO tutorial.ipynb - Colaboratory - Google Colab
In this tutorial, we will train a 3D U-Net to perform brain segmentation from T1-weighted MRI using the Information eXtraction from Images (IXI)...
Read more >
TorchIO
TorchIO is an open-source Python library for efficient loading, preprocessing, augmentation and patch-based sampling of 3D medical images in deep learning, ...
Read more >
Complete Beginner's Tutorial to Google Colab - YouTube
Google Colab Tutorial for Beginners | Get Started with Google Colab · Mix - Greg Hogg · Jupyter Notebook Complete Beginner Guide 2023...
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