thuml / Time-Series-Library

A Library for Advanced Deep Time Series Models.
MIT License
6.35k stars 1.01k forks source link

module 'torch.optim' has no attribute 'RAdam' #439

Closed liaom5 closed 2 months ago

liaom5 commented 3 months ago

你好,我更改了新的torch 版本到2.3 exp\exp_classification.py", line 40, in _select_optimizer model_optim = optim.RAdam(self.model.parameters(), lr=self.args.learning_rate) AttributeError: module 'torch.optim' has no attribute 'RAdam' 但依旧会没有优化器的错误

使用原有的要求文档里的环境跑同样也没是一样的报错

mayii2001 commented 2 months ago

linux 以下环境(conda导出)可以正常运行,需要删除mamba

channels:
  - pytorch
  - <unknown>
  - defaults
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - blas=1.0=mkl
  - brotli-python=1.0.9=py38h6a678d5_8
  - bzip2=1.0.8=h5eee18b_6
  - ca-certificates=2024.3.11=h06a4308_0
  - certifi=2024.6.2=py38h06a4308_0
  - charset-normalizer=2.0.4=pyhd3eb1b0_0
  - cudatoolkit=11.3.1=h2bc3f7f_2
  - cudnn=8.9.2.26=cuda11_0
  - ffmpeg=4.3=hf484d3e_0
  - freetype=2.12.1=h4a9f257_0
  - giflib=5.2.1=h5eee18b_3
  - gmp=6.2.1=h295c915_3
  - gnutls=3.6.15=he1e5248_0
  - idna=3.7=py38h06a4308_0
  - intel-openmp=2023.1.0=hdb19cb5_46306
  - jpeg=9b=h024ee3a_2
  - lame=3.100=h7b6447c_0
  - lcms2=2.12=h3be6417_0
  - ld_impl_linux-64=2.38=h1181459_1
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libiconv=1.16=h5eee18b_3
  - libidn2=2.3.4=h5eee18b_0
  - libpng=1.6.39=h5eee18b_0
  - libstdcxx-ng=11.2.0=h1234567_1
  - libtasn1=4.19.0=h5eee18b_0
  - libtiff=4.2.0=h85742a9_0
  - libunistring=0.9.10=h27cfd23_0
  - libuv=1.44.2=h5eee18b_0
  - libwebp=1.2.0=h89dd481_0
  - libwebp-base=1.2.0=h27cfd23_0
  - lz4-c=1.9.4=h6a678d5_1
  - mkl=2023.1.0=h213fc3f_46344
  - mkl-service=2.4.0=py38h5eee18b_1
  - mkl_fft=1.3.8=py38h5eee18b_0
  - mkl_random=1.2.4=py38hdb19cb5_0
  - ncurses=6.4=h6a678d5_0
  - nettle=3.7.3=hbbd107a_1
  - ninja=1.10.2=h06a4308_5
  - ninja-base=1.10.2=hd09550d_5
  - openh264=2.1.1=h4ff587b_0
  - openssl=3.0.14=h5eee18b_0
  - pillow=9.3.0=py38hace64e9_1
  - pip=24.0=py38h06a4308_0
  - pysocks=1.7.1=py38h06a4308_0
  - python=3.8.19=h955ad1f_0
  - pytorch=1.12.1=py3.8_cuda11.3_cudnn8.3.2_0
  - pytorch-mutex=1.0=cuda
  - readline=8.2=h5eee18b_0
  - requests=2.32.2=py38h06a4308_0
  - setuptools=69.5.1=py38h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tbb=2021.8.0=hdb19cb5_0
  - tk=8.6.14=h39e8969_0
  - torchaudio=0.12.1=py38_cu113
  - torchvision=0.13.1=py38_cu113
  - typing_extensions=4.11.0=py38h06a4308_0
  - urllib3=2.2.2=py38h06a4308_0
  - wheel=0.43.0=py38h06a4308_0
  - xz=5.4.6=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - zstd=1.4.9=haebb681_0
  - pip:
      - axial-positional-embedding==0.2.1
      - contourpy==1.1.1
      - cycler==0.12.1
      - deprecated==1.2.14
      - einops==0.5.0
      - fonttools==4.53.0
      - importlib-metadata==8.0.0
      - importlib-resources==6.4.0
      - joblib==1.4.2
      - kiwisolver==1.4.5
      - llvmlite==0.41.1
      - local-attention==1.4.4
      - matplotlib==3.7.0
      - mpmath==1.3.0
      - numba==0.58.1
      - numpy==1.23.5
      - packaging==24.1
      - pandas==1.5.3
      - patool==1.12
      - product-key-memory==0.1.10
      - pyparsing==3.1.2
      - python-dateutil==2.9.0.post0
      - pytz==2024.1
      - reformer-pytorch==1.4.4
      - scikit-learn==1.2.2
      - scipy==1.10.1
      - six==1.16.0
      - sktime==0.16.1
      - sympy==1.11.1
      - threadpoolctl==3.5.0
      - tqdm==4.64.1
      - wrapt==1.16.0
      - zipp==3.19.2
liaom5 commented 2 months ago

是的,已经删除成功跑通了.谢谢

On Wed, Jul 3, 2024 at 12:12 PM 马乐尧 @.***> wrote:

linux 以下环境可以正常运行,需要删除mamba `name: tsl channels:

  • pytorch
  • defaults dependencies:
  • _libgcc_mutex=0.1=main
  • _openmp_mutex=5.1=1_gnu
  • blas=1.0=mkl
  • brotli-python=1.0.9=py38h6a678d5_8
  • bzip2=1.0.8=h5eee18b_6
  • ca-certificates=2024.3.11=h06a4308_0
  • certifi=2024.6.2=py38h06a4308_0
  • charset-normalizer=2.0.4=pyhd3eb1b0_0
  • cudatoolkit=11.3.1=h2bc3f7f_2
  • cudnn=8.9.2.26=cuda11_0
  • ffmpeg=4.3=hf484d3e_0
  • freetype=2.12.1=h4a9f257_0
  • giflib=5.2.1=h5eee18b_3
  • gmp=6.2.1=h295c915_3
  • gnutls=3.6.15=he1e5248_0
  • idna=3.7=py38h06a4308_0
  • intel-openmp=2023.1.0=hdb19cb5_46306
  • jpeg=9b=h024ee3a_2
  • lame=3.100=h7b6447c_0
  • lcms2=2.12=h3be6417_0
  • ld_impl_linux-64=2.38=h1181459_1
  • libffi=3.4.4=h6a678d5_1
  • libgcc-ng=11.2.0=h1234567_1
  • libgomp=11.2.0=h1234567_1
  • libiconv=1.16=h5eee18b_3
  • libidn2=2.3.4=h5eee18b_0
  • libpng=1.6.39=h5eee18b_0
  • libstdcxx-ng=11.2.0=h1234567_1
  • libtasn1=4.19.0=h5eee18b_0
  • libtiff=4.2.0=h85742a9_0
  • libunistring=0.9.10=h27cfd23_0
  • libuv=1.44.2=h5eee18b_0
  • libwebp=1.2.0=h89dd481_0
  • libwebp-base=1.2.0=h27cfd23_0
  • lz4-c=1.9.4=h6a678d5_1
  • mkl=2023.1.0=h213fc3f_46344
  • mkl-service=2.4.0=py38h5eee18b_1
  • mkl_fft=1.3.8=py38h5eee18b_0
  • mkl_random=1.2.4=py38hdb19cb5_0
  • ncurses=6.4=h6a678d5_0
  • nettle=3.7.3=hbbd107a_1
  • ninja=1.10.2=h06a4308_5
  • ninja-base=1.10.2=hd09550d_5
  • openh264=2.1.1=h4ff587b_0
  • openssl=3.0.14=h5eee18b_0
  • pillow=9.3.0=py38hace64e9_1
  • pip=24.0=py38h06a4308_0
  • pysocks=1.7.1=py38h06a4308_0
  • python=3.8.19=h955ad1f_0
  • pytorch=1.12.1=py3.8_cuda11.3_cudnn8.3.2_0
  • pytorch-mutex=1.0=cuda
  • readline=8.2=h5eee18b_0
  • requests=2.32.2=py38h06a4308_0
  • setuptools=69.5.1=py38h06a4308_0
  • sqlite=3.45.3=h5eee18b_0
  • tbb=2021.8.0=hdb19cb5_0
  • tk=8.6.14=h39e8969_0
  • torchaudio=0.12.1=py38_cu113
  • torchvision=0.13.1=py38_cu113
  • typing_extensions=4.11.0=py38h06a4308_0
  • urllib3=2.2.2=py38h06a4308_0
  • wheel=0.43.0=py38h06a4308_0
  • xz=5.4.6=h5eee18b_1
  • zlib=1.2.13=h5eee18b_1
  • zstd=1.4.9=haebb681_0
  • pip:
    • axial-positional-embedding==0.2.1
    • contourpy==1.1.1
    • cycler==0.12.1
    • deprecated==1.2.14
    • einops==0.5.0
    • fonttools==4.53.0
    • importlib-metadata==8.0.0
    • importlib-resources==6.4.0
    • joblib==1.4.2
    • kiwisolver==1.4.5
    • llvmlite==0.41.1
    • local-attention==1.4.4
    • matplotlib==3.7.0
    • mpmath==1.3.0
    • numba==0.58.1
    • numpy==1.23.5
    • packaging==24.1
    • pandas==1.5.3
    • patool==1.12
    • product-key-memory==0.1.10
    • pyparsing==3.1.2
    • python-dateutil==2.9.0.post0
    • pytz==2024.1
    • reformer-pytorch==1.4.4
    • scikit-learn==1.2.2
    • scipy==1.10.1
    • six==1.16.0
    • sktime==0.16.1
    • sympy==1.11.1
    • threadpoolctl==3.5.0
    • tqdm==4.64.1
    • wrapt==1.16.0
    • zipp==3.19.2 `

— Reply to this email directly, view it on GitHub https://github.com/thuml/Time-Series-Library/issues/439#issuecomment-2206724801, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5B6TLC7PQFTZWBGA52APQ3ZKQPHVAVCNFSM6AAAAABJRMTMD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBWG4ZDIOBQGE . You are receiving this because you authored the thread.Message ID: @.***>

wuhaixu2016 commented 2 months ago

@mayii2001 感谢回复

forever-free commented 3 weeks ago

改torch==2.4.0就好了