1、第一次安裝時出現錯誤:
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 5.0 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 5 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
解決方案:pytorch需要gcc版本>4.9,學院服務器自帶gcc版本為4.8.5,升級gcc版本,並保證gcc與g++版本一致
學院服務器無root權限時需要在conda環境下升級gcc,再添加軟鏈接
ln -s /public/home/G19860004/anaconda3/envs/cll/libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/gcc /public/home/G19860004/anaconda3/envs/cll/bin/gcc ln -s /public/home/G19860004/anaconda3/envs/cll/libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/gcc /public/home/G19860004/anaconda3/envs/cll/bin/g++
2、第二次安裝出現錯誤
/public/home/G19860004/anaconda3/envs/cll/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: cannot find -lgomp
解決方案:缺少鏈接庫libgomp,conda環境下安裝即可
conda install libgomp
成功安裝。
總結:一開始安裝時沒有好好看作者寫的notice,gcc版本的問題其實已經被提到了;另外一看到大段的報錯就產生了懈怠心理,不去仔細看報錯的內容,反而導致浪費了很多時間做無用功。
