chatglm_finetuning icon indicating copy to clipboard operation
chatglm_finetuning copied to clipboard

AttributeError: module 'torch.optim' has no attribute 'adam'

Open evanweiguohua opened this issue 1 year ago • 5 comments

PTV2将优化器设置为adam会报AttributeError: module 'torch.optim' has no attribute 'adam'的错误,adamw是好的。 Lora则没有该问题。

evanweiguohua avatar Jul 10 '23 06:07 evanweiguohua

配置如下:

模块配置, 默认启用lora

enable_deepspeed = True enable_ptv2 = True enable_lora = False enable_int8 = False # qlora int8 enable_int4 = False # qlora int4

evanweiguohua avatar Jul 10 '23 06:07 evanweiguohua

pip list |grep torch

ssbuild avatar Jul 10 '23 06:07 ssbuild

pytorch-lightning 2.0.4 torch 2.0.1 torchaudio 2.0.2 torchmetrics 1.0.0 torchvision 0.15.2

evanweiguohua avatar Jul 10 '23 06:07 evanweiguohua

pip uninstall deep_training pip install -U git+https://github.com/ssbuild/deep_training.git

it is bug and fixed , do upgrade can solve.

ssbuild avatar Jul 10 '23 06:07 ssbuild

Thanks a lot. I'll try it.

evanweiguohua avatar Jul 10 '23 07:07 evanweiguohua