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 in tio.RandomAffine: 'Transform' object has no attribute 'AddTransform'

See original GitHub issue

🐛Bug Missing ‘AddTransform’ attribute in ‘Transform’ object from tio.RandomAffine.

To reproduce

I used your Colab Tutorial for Data Preprocessing and Data Augmentation, and in the example in section Spatial Transforms > Random Affine with the code.

random_affine = tio.RandomAffine(seed=0)
slice_affine = random_affine(slice_grid)
to_pil(slice_affine)

i get this error in the second line of code.

AttributeError: 'Transform' object has no attribute 'AddTransform'

Expected behavior

Random Affine transformation of the example grid

Actual behavior

Error

TorchIO version

0.17.25

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JavierBZcommented, Oct 14, 2020

Hi, Fernando.

  1. The example is on your public tutorial on section Spatial Transforms > Random Affine.

  2. I tried the latest version and it works now! i think the problem is in your setup code of the tutorial

!pip install torchio==0.17.25 --quiet

Probably that version causes the problem in RandomAffine.

Thanks for your quick reply!

0reactions
fepegarcommented, Nov 29, 2021

Hi, @Binztech. Can you please upgrade TorchIO and try again? And if it still does not work, can you open a new issue and share a minimal working example?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transform object has no attribute GetInverseTransform
The error message indicates that SimpleITK Transform object does not have a "GetInverseTransform" method. The proper method to call is just ...
Read more >
torchio.transforms.augmentation.spatial.random_affine
transformed = transform(image) .. plot:: import torchio as tio subject = tio.datasets.Slicer('CTChest') ct = subject.CT_chest transform = tio.RandomAffine() ...
Read more >
Transforms — MONAI 1.1.0 Documentation
R calls happen here so that we have a better chance to identify errors of sync the random state. This method can generate...
Read more >
TorchIO: A Python library for efficient loading, preprocessing ...
for deep learning with medical images. Keywords: Medical image computing, deep learning, data augmentation, preprocessing. 1. Introduction.
Read more >
How to perform random affine transformation of an image?
transforms module. RandomAffine() transformation accepts both PIL and tensor images. A tensor image is a PyTorch tensor with shape [C, H, W], ...
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