I have the some problem when import apex on colab.
the wdir is apex, I execute the code to install apex
!git clone https://github.com/NVIDIA/apex.git
%cd apex
!pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext"
But it seems that it fails to find the path of fp16_optimizer and FusedAdam at optimizer folder
ImportError: cannot import name 'FP16_Optimizer'
ImportError: Please install apex from https://www.github.com/nvidia/apex
Are you directly importing FP16_Optimizer in your code?
If so, the current apex version might produce this issue, as FP16_Optimizer was moved to contrib/optimizers.
That being said, FP16_Optimizer is deprecated, so please don't import and use it manually.
Let us know, if that fixes the problem.
Yes it fixes the problem, thx!
I was executing code from some outdated example, in which FP16_Optimizer was used.
Thanks for your assistance!
Are you directly importing
FP16_Optimizerin your code?
If so, the currentapexversion might produce this issue, asFP16_Optimizerwas moved to contrib/optimizers.That being said,
FP16_Optimizeris deprecated, so please don't import and use it manually.Let us know, if that fixes the problem.
Thanks for your suggestion so much!
I solve this problem by changing the original code:
Original code: from apex.optimizers import FusedAdam
Correct code: from apex.contrib.optimizers import FusedAdam
Most helpful comment
Are you directly importing
FP16_Optimizerin your code?If so, the current
apexversion might produce this issue, asFP16_Optimizerwas moved to contrib/optimizers.That being said,
FP16_Optimizeris deprecated, so please don't import and use it manually.Let us know, if that fixes the problem.