![](https://img-blog.csdnimg.cn/8ad975b5ec914fbb83155a2cf84e6ffc.png)
After reading the solution on nvidia/APEX, I solved it by the following steps:
git clone https://github.com/NVIDIA/apex vim apex/amp/utils.py # change this line (line 97) # torch-version: 1.10.1 - if cached_x.grad_fn.next_functions[1][0].variable is not x: # into this + if cached_x.grad_fn.next_functions[0][0].variable is not x: # Then cd apex pip3 install -v --no-cache-dir ./