Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: The provided lr scheduler "<torch.optim.lr_scheduler.LambdaLR object at 0x7fda400bdee0>" is invalid #10

Open
arunraja-hub opened this issue Oct 10, 2023 · 4 comments

Comments

@arunraja-hub
Copy link

arunraja-hub commented Oct 10, 2023

Hi @kxz18 , I am trying to run your repo locally. I have the same package versions of the libraries you are using and I am getting File ".../lib/python3.9/site-packages/pytorch_lightning/trainer/optimizers.py", line 192, in _configure_schedulers raise ValueError(f'The provided lr scheduler "{scheduler}" is invalid') ValueError: The provided lr scheduler "<torch.optim.lr_scheduler.OneCycleLR object at 0x151eea83f520>" is invalid when I run train.py. This seems to be an issue with Lightning but I have the exact same version of Lightning as your codebase so I am not sure why this error is occuring. Is there any workaround?

This is the output after I run collect_env:

Collecting environment information...
.../lib/python3.9/site-packages/torch/cuda/__init__.py:173: UserWarning: 
NVIDIA H100 PCIe with CUDA capability sm_90 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 compute_37.
If you want to use the NVIDIA H100 PCIe GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
PyTorch version: 2.0.1
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: CentOS Linux release 8.1.1911 (Core)  (x86_64)
GCC version: (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4)
Clang version: Could not collect
CMake version: version 3.11.4
Libc version: glibc-2.28

Python version: 3.9.17 (main, Jul  5 2023, 20:41:20)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-4.18.0-147.8.1.el8_2.arc.x86_64-x86_64-with-glibc2.28
Is CUDA available: True
CUDA runtime version: 11.7.64
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA H100 PCIe
GPU 1: NVIDIA H100 PCIe
GPU 2: NVIDIA H100 PCIe
GPU 3: NVIDIA H100 PCIe

Nvidia driver version: 525.116.04
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              48
On-line CPU(s) list: 0-47
Thread(s) per core:  1
Core(s) per socket:  24
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               106
Model name:          Intel(R) Xeon(R) Gold 6342 CPU @ 2.80GHz
Stepping:            6
CPU MHz:             800.421
BogoMIPS:            5600.00
Virtualization:      VT-x
L1d cache:           48K
L1i cache:           32K
L2 cache:            1280K
L3 cache:            36864K
NUMA node0 CPU(s):   0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46
NUMA node1 CPU(s):   1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid md_clear pconfig flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.24.3
[pip3] pytorch-lightning==1.5.7
[pip3] torch==2.0.1
[pip3] torch-geometric==2.3.1
[pip3] torchaudio==0.8.1
[pip3] torchmetrics==0.9.3
[pip3] torchvision==0.15.2
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1              h9edb442_10    conda-forge
[conda] cudatoolkit-dev           11.7.0               h1de0b5d_6    conda-forge
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7e14d7c_0    conda-forge
[conda] mkl_fft                   1.3.1            py39h0c7bc48_1    conda-forge
[conda] mkl_random                1.2.2            py39hde0f152_0    conda-forge
[conda] numpy                     1.26.0                   pypi_0    pypi
[conda] numpy-base                1.24.3           py39h31eccc5_0  
[conda] pyg                       2.3.1           py39_torch_2.0.0_cu117    pyg
[conda] pytorch                   2.0.1           py3.9_cuda11.7_cudnn8.5.0_0    pytorch
[conda] pytorch-cuda              11.7                 h778d358_5    pytorch
[conda] pytorch-lightning         1.5.7                    pypi_0    pypi
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.8.1                    pypi_0    pypi
[conda] torchmetrics              0.9.3                    pypi_0    pypi
[conda] torchtriton               2.0.0                      py39    pytorch
[conda] torchvision               0.9.1+cu101              pypi_0    pypi
@kxz18
Copy link
Collaborator

kxz18 commented Oct 10, 2023

Hi, I think it might be because that pytorch 2.0.1 is used here. The base class of schedulers is _LRScheduler in versions below 2.0.0 (see here), which is used for if-else in pytorch-lightning 1.5.7 (see here). However, the name is changed to LRScheduler in versions above 2.0.0 (see here). Therefore, I think downgrade pytorch to versions below 2.0.0 might solve the problem.

@arunraja-hub
Copy link
Author

arunraja-hub commented Oct 10, 2023

In that case, please make sure your requirements.txt is updated. For instance, the wheel for torch==1.8.1+cu101 is no longer available. I had to install Pytorch 2.0 and that resulted in this issue. Over the past week I have just worked on setting up 10 different virtual environments with various combinations of torch,lightning, pyg, sparse, scatter etc. but i still cant get your code to work. Please kindly check the requirement.txt file

@arunraja-hub
Copy link
Author

arunraja-hub commented Oct 10, 2023

I somehow managed to replicate your requirements.txt environment after reinstalling via various methods.
But I am getting the following error at the bottom

Collecting environment information...
PyTorch version: 1.8.1+cu101
Is debug build: False
CUDA used to build PyTorch: 10.1
ROCM used to build PyTorch: N/A

OS: CentOS Linux release 8.1.1911 (Core)  (x86_64)
GCC version: (GCC) 8.3.1 20190507 (Red Hat 8.3.1-4)
Clang version: Could not collect
CMake version: version 3.11.4

Python version: 3.8 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration: 
GPU 0: NVIDIA H100 PCIe
GPU 1: NVIDIA H100 PCIe

Nvidia driver version: 525.116.04
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.24.4
[pip3] pytorch-lightning==1.5.7
[pip3] torch==1.8.1+cu101
[pip3] torch-cluster==1.6.0
[pip3] torch-geometric==2.1.0.post1
[pip3] torch-scatter==2.0.9
[pip3] torch-sparse==0.6.12
[pip3] torch-spline-conv==1.2.1
[pip3] torchaudio==0.8.1
[pip3] torchmetrics==0.9.3
[pip3] torchvision==0.9.1+cu101
[conda] cudatoolkit               10.1.243             h6bb024c_0  
[conda] cudatoolkit-dev           10.1.243             h516909a_3    conda-forge
[conda] numpy                     1.24.4                   pypi_0    pypi
[conda] pytorch-lightning         1.5.7                    pypi_0    pypi
[conda] torch                     1.8.1+cu101              pypi_0    pypi
[conda] torch-cluster             1.6.0                    pypi_0    pypi
[conda] torch-geometric           2.1.0.post1              pypi_0    pypi
[conda] torch-scatter             2.0.9                    pypi_0    pypi
[conda] torch-sparse              0.6.12                   pypi_0    pypi
[conda] torch-spline-conv         1.2.1                    pypi_0    pypi
[conda] torchaudio                0.8.1                    pypi_0    pypi
[conda] torchmetrics              0.9.3                    pypi_0    pypi
[conda] torchvision               0.9.1+cu101              pypi_0    pypi

OSError: /.../lib/python3.8/site-packages/torch_spline_conv/_basis_cuda.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceIdEEPKNS_6detail12TypeMetaDataEv

@kxz18
Copy link
Collaborator

kxz18 commented Oct 11, 2023

Hi, I've updated procedure for installing the dependencies in the README. I apologize for the inconvenience caused by the previous buggy requirements.txt. As for the newly posted problem, I think it might be related to the problem mentioned in the official pages of torch-geometric here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants