Time-Series-Library icon indicating copy to clipboard operation
Time-Series-Library copied to clipboard

python package local-attention release 1.9.15 causes ModuleNotFoundError: No module named 'torch.amp'

Open yitaochen opened this issue 1 year ago • 6 comments

Per the title says. Could you include local-attention==1.9.14 in the requirements.txt

yitaochen avatar Sep 06 '24 20:09 yitaochen

That was helpful!

moured avatar Sep 15 '24 12:09 moured

Hi. Thank you for your issue. Firstly, the module we use is torch.cuda.amp, not torch.amp; Secondly, local-attention is a dependency of other packages we require.If you configure the environment according to requirements.txt, the appropriate version should be automatically downloaded without the need for explicit settings. If the version of your package local-attention causes ModuleNotFoundError, you may consider reconfiguring the appropriate version as you say. Please feel free to continue discussing if you have any further questions.

Musongwhk avatar Sep 18 '24 12:09 Musongwhk

Yes, for some reason the author of local-attention packet made the following change between release 1.9.14 and 1.9.15:

- from torch.cuda.amp import autocast
+ from torch.amp import autocast

I was just thinking it'd be helpful if you can mention this somewhere in the doc, so people don't have to spend time on this issue.

yitaochen avatar Sep 18 '24 17:09 yitaochen

Thank you for your information! We also reproduce ModuleNotFoundError. If we configure the environment according to requirements.txt, local-attention version will be 1.9.15. Your discussion may be helpful to others who have similar doubts. We will consider mentioning this in requirements.txt or somewhere else.

Musongwhk avatar Sep 19 '24 07:09 Musongwhk

The same applies to CoLT5-attention, which also requires a lower version. I successfully ran it with version 0.10.20.

Et6an avatar Sep 28 '24 00:09 Et6an

The same applies to CoLT5-attention, which also requires a lower version. I successfully ran it with version 0.10.20.

God you are my god

HanZhaang avatar Jul 03 '25 13:07 HanZhaang