Skip to content

PyTorch >=2.5.0 - TypeError: Type parameter +RV without a default follows type parameter with a defaultΒ #1441

@tanwarsh

Description

@tanwarsh

Describe the bug
Version:
PyTorch >=2.5.0
PIP > 24.1.2
Torchvision >=0.20.1

The error shown in screenshot below occurs when using a dataset with PyTorch and Torchvision.

To Reproduce
Steps to reproduce the behavior:

  1. Follow https://openfl.readthedocs.io/en/latest/tutorials/taskrunner.html# and run torch/mnist workspace with version mentioned above.

Expected behavior
The experiment should run without any issues.

Screenshots

Image

Solution

  1. Use PIP version <=24.1.2 for dependency management.
  2. Apply the following patch before importing datasets from torchvision.
import sys
import typing_extensions
sys.modules["pip._vendor.typing_extensions"] = typing_extensions
from torchvision import datasets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions