用了官方做法
git clone https://github.com/NVIDIA/apex (这一步ok)
cd apex(ok)
最后一步报错:pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
ERROR: Command errored out with exit status 1: /opt/c50017935/condaenv/ViT/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-j19rw84j/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-j19rw84j/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-wd3fgg7r/install-record.txt --single-version-externally-managed --compile --install-headers /opt/c50017935/condaenv/ViT/include/python3.6m/apex Check the logs for full command output.
解决办法
git clone https://github.com/NVIDIA/apex
cd apex
python3 setup.py install