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.

AttributeError: module 'torchvision.ops._utils' has no attribute 'split_normalization_params'

See original GitHub issue

🐛 Describe the bug

Currently using torchvision==0.11.3, and following the training recipe [here](https://github.com/pytorch/vision/blob/main/references/classification/train.py). I get the following error, and by looking at the methods in the version of torchvision I have, it isn't available. The Nightly` version doesn’t contain it either.

Traceback (most recent call last):
  File "/Users/en_tetteh/miniforge3/envs/venv_ivadomed/bin/ivadomed", line 33, in <module>
    sys.exit(load_entry_point('ivadomed', 'console_scripts', 'ivadomed')())
  File "/Users/en_tetteh/NEUROPOLY/ivadomed/ivadomed/main.py", line 593, in run_main
    run_command(context=context,
  File "/Users/en_tetteh/NEUROPOLY/ivadomed/ivadomed/main.py", line 429, in run_command
    best_training_dice, best_training_loss, best_validation_dice, best_validation_loss = imed_training.train(
  File "/Users/en_tetteh/NEUROPOLY/ivadomed/ivadomed/training.py", line 117, in train
    param_groups = torchvision.ops._utils.split_normalization_params(model)
AttributeError: module 'torchvision.ops._utils' has no attribute 'split_normalization_params'

Versions

Collecting environment information… PyTorch version: 1.10.2 Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A

OS: macOS 12.2.1 (arm64) GCC version: Could not collect Clang version: 13.0.0 (clang-1300.0.29.30) CMake version: Could not collect Libc version: N/A

Python version: 3.9.10 | packaged by conda-forge | (main, Feb 1 2022, 21:25:34) [Clang 11.1.0 ] (64-bit runtime) Python platform: macOS-12.2.1-arm64-arm-64bit Is CUDA available: False CUDA runtime version: No CUDA GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A

Versions of relevant libraries: [pip3] numpy==1.22.2 [pip3] torch==1.10.2 [pip3] torchio==0.18.73 [pip3] torchvision==0.11.3 [conda] cpuonly 1.0 0 pytorch-nightly [conda] numpy 1.22.2 py39h61a45d2_0 conda-forge [conda] torch 1.10.2 pypi_0 pypi [conda] torchio 0.18.73 pypi_0 pypi [conda] torchvision 0.11.3 pypi_0 pypi

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
datumboxcommented, Feb 22, 2022

The problem is you are using the latest training scripts on main branch with and old torchvision version (0.11.3). This method does not exist on 0.11.3. I’ve added it in late October last year which was past the branch cut for v0.11 (see #4493). I’m pretty sure you will find it on the latest nightly of torchvision because its been on our main branch for months.

I recommend to check again the versions that you are using when installing the nightly. I’ll close the issue but if you face more problems let me know.

0reactions
etettehcommented, Feb 23, 2022

Okay. Thank you so much. I was following the article because I am using the recipe for research and wanted to know how the various parts contribute to the overall metric just as in the article.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'torchvision' has no attribute 'ops' · Issue ...
Desktop (please complete the following information):. OS: linux; Version 18. Additional context. i have old version of utils which works fine.
Read more >
AttributeError: module 'torchvision' has no attribute '__version__'
I'm using Windows, conda environment, installed Pytorch-1.7.1, Torchvision-0.8.2, Cuda-Toolkit-11.0 > all compatible. ... I have to know if my ...
Read more >
AttributeError: module 'transforms' has no attribute 'Normalize'
It seems you are importing a custom transforms module and not torchvision.transforms , which doesn't seem to have the Normalize transformation.
Read more >
Setup help: "torchvision 0.11.1 requires torch==1.10.0, but you ...
I have just setup a Jupyter Notebook with Paperspace Gradient. ... 30 AttributeError: module 'torch' has no attribute '_assert'.
Read more >
module 'torchvision' has no attribute '__version__' - You.com
Steps to reproduce the behavior: print("Torchvision Version: ",torchvision.__version__). AttributeError: module 'torchvision' has no attribute 'version ...
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