Skip to content

Issue with torch 1.13 #285

Closed
Closed
@dmtrs

Description

@dmtrs

🐛 Describe the bug

Can not import torchtnt.framework due to AttributeError.

Traceback (most recent call last):
  File "/Users/foo/app/runner/trainer/__init__.py", line 4, in <module>
    import torchtnt.framework
  File "/Users/foo/Library/Caches/pypoetry/virtualenvs/sp-mcom8aNU-py3.9/lib/python3.9/site-packages/torchtnt/framework/__init__.py", line 7, in <module>
    from .auto_unit import AutoUnit
  File "/Users/foo/Library/Caches/pypoetry/virtualenvs/sp-mcom8aNU-py3.9/lib/python3.9/site-packages/torchtnt/framework/auto_unit.py", line 23, in <module>
    from torchtnt.framework.unit import EvalUnit, PredictUnit, TrainUnit
  File "/Users/foo/Library/Caches/pypoetry/virtualenvs/sp-mcom8aNU-py3.9/lib/python3.9/site-packages/torchtnt/framework/unit.py", line 24, in <module>
    TLRScheduler = torch.optim.lr_scheduler.LRScheduler
AttributeError: module 'torch.optim.lr_scheduler' has no attribute 'LRScheduler'

From torch documentation it does not seem to have a torch.optim.lr_scheduler in stable version. https://pytorch.org/docs/stable/optim.html. Please also see BC-breaking change after 1.10 that may affect optimizer and lr step.

From requirements.txt it does not seem this is locked in particular torch version.

What is current working supported torch version for torchtnt=0.0.4? Is there plans to have particular supported torch versions?

Versions

% poetry run python collect_env.py                                                                                                                                                                      ✹ ✭
Collecting environment information...
PyTorch version: 1.13.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 10.14.6 (x86_64)
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.13 (main, Sep  3 2022, 22:36:35)  [Clang 10.0.1 (clang-1001.0.46.4)] (64-bit runtime)
Python platform: macOS-10.14.6-x86_64-i386-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
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
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.5
[pip3] torch==1.13.1
[pip3] torchtnt==0.0.4
[conda] Could not collect

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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