I’m new in PyTorch. After installation of PyTorch1.0(stable), I try to import torch in code and an error occurs:

捕获.JPG1343×166 41.6 KB

The following is the whole running procedures:


Create a new environment in conda. e.g., “conda create -n pytorch python=3.6”
Install PyTorch following the website:

捕获.JPG1320×328 32 KB


activate the environment and try to import torch in python


The configurations in my system are:


system type: CentOS Linux release 7.4.1708 (Core)
GPU: Tesla P100
CUDA version: 9.1.85
CuDNN version: 7.4.1


The result of “ldd libtorch.so.1” is(a little messy):


Summary
(pytorch) [heliang04@c4130-005 torch_ver]$ ldd /home/heliang04/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/libtorch.so.1
linux-vdso.so.1 =>  (0x00002aaaaaaab000)
libnvToolsExt-3965bdd0.so.1 => /home/heliang04/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/libnvToolsExt-3965bdd0.so.1 (0x00002aaaaba09000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaabc36000)
librt.so.1 => /lib64/librt.so.1 (0x00002aaaabe3a000)
libcaffe2.so => /cm/shared/apps/caffe2/0.8.1/lib/libcaffe2.so (0x00002aaaac043000)
libcaffe2_gpu.so => /cm/shared/apps/caffe2/0.8.1/lib/libcaffe2_gpu.so (0x00002aaaacea0000)
libc10.so => /home/heliang04/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/lib/libc10.so (0x00002aaaafa88000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaafcad000)
libm.so.6 => /lib64/libm.so.6 (0x00002aaaafec9000)
libstdc++.so.6 => /cm/local/apps/gcc/7.2.0/lib64/libstdc++.so.6 (0x00002aaab01cb000)
libgcc_s.so.1 => /cm/local/apps/gcc/7.2.0/lib64/libgcc_s.so.1 (0x00002aaab054d000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaab0764000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
libcudnn.so.7 => /home/heliang04/tools/cuda/lib64/libcudnn.so.7 (0x00002aaab0b27000)
libnccl.so.2 => /cm/shared/apps/nccl2/2.1.15/lib/libnccl.so.2 (0x00002aaac30d8000)
libgflags.so.2.1 => /lib64/libgflags.so.2.1 (0x00002aaad0979000)
libglog.so.0 => /lib64/libglog.so.0 (0x00002aaad0b9a000)
liblmdb.so.0.0.0 => /lib64/liblmdb.so.0.0.0 (0x00002aaad0dcb000)
libleveldb.so.1 => /lib64/libleveldb.so.1 (0x00002aaad0fe0000)
libsnappy.so.1 => /lib64/libsnappy.so.1 (0x00002aaad1234000)
libopencv_highgui.so.3.1 => /cm/shared/apps/opencv3/3.1.0/lib/libopencv_highgui.so.3.1 (0x00002aaad143b000)
libmpi.so.40 => /cm/shared/apps/openmpi/cuda/64/3.0.0/lib64/libmpi.so.40 (0x00002aaad1648000)
libopencv_imgcodecs.so.3.1 => /cm/shared/apps/opencv3/3.1.0/lib/libopencv_imgcodecs.so.3.1 (0x00002aaad1924000)
libopencv_imgproc.so.3.1 => /cm/shared/apps/opencv3/3.1.0/lib/libopencv_imgproc.so.3.1 (0x00002aaad1d5d000)
libopencv_core.so.3.1 => /cm/shared/apps/opencv3/3.1.0/lib/libopencv_core.so.3.1 (0x00002aaad3715000)
libcudart.so.9.1 => /cm/shared/apps/cuda91/toolkit/9.1.85/lib64/libcudart.so.9.1 (0x00002aaad43e5000)
libcurand.so.9.1 => /cm/shared/apps/cuda91/toolkit/9.1.85/lib64/libcurand.so.9.1 (0x00002aaad4653000)
libcublas.so.9.1 => /cm/shared/apps/cuda91/toolkit/9.1.85/lib64/libcublas.so.9.1 (0x00002aaad85d6000)
libcuda.so.1 => /cm/local/apps/cuda/libs/current/lib64/libcuda.so.1 (0x00002aaadbb6e000)
libnvrtc.so.9.1 => /cm/shared/apps/cuda91/toolkit/9.1.85/lib64/libnvrtc.so.9.1 (0x00002aaadc70e000)
libopencv_videoio.so.3.1 => /cm/shared/apps/opencv3/3.1.0/lib/libopencv_videoio.so.3.1 (0x00002aaadde3b000)
libgtk-3.so.0 => /lib64/libgtk-3.so.0 (0x00002aaade061000)
libgdk-3.so.0 => /lib64/libgdk-3.so.0 (0x00002aaade96b000)
libatk-1.0.so.0 => /lib64/libatk-1.0.so.0 (0x00002aaadec24000)
libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00002aaadee4a000)
libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0 (0x00002aaadf1de000)
libgdk_pixbuf-2.0.so.0 => /lib64/libgdk_pixbuf-2.0.so.0 (0x00002aaadf3ec000)
libcairo-gobject.so.2 => /lib64/libcairo-gobject.so.2 (0x00002aaadf614000)
libpango-1.0.so.0 => /lib64/libpango-1.0.so.0 (0x00002aaadf81d000)
libcairo.so.2 => /lib64/libcairo.so.2 (0x00002aaadfa69000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00002aaadfd91000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00002aaadffe1000)
libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00002aaae02f4000)
libopen-rte.so.40 => /cm/shared/apps/openmpi/cuda/64/3.0.0/lib64/libopen-rte.so.40 (0x00002aaae04f6000)
libopen-pal.so.40 => /cm/shared/apps/openmpi/cuda/64/3.0.0/lib64/libopen-pal.so.40 (0x00002aaae07a8000)
libnuma.so.1 => /lib64/libnuma.so.1 (0x00002aaae0aac000)
libudev.so.1 => /lib64/libudev.so.1 (0x00002aaae0cb8000)
libnvidia-ml.so.1 => /cm/shared/apps/cuda91/toolkit/9.1.85/lib64/libnvidia-ml.so.1 (0x00002aaae0cce000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002aaae12a6000)
libz.so.1 => /lib64/libz.so.1 (0x00002aaae14a9000)
libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00002aaae16c0000)
libpng15.so.15 => /lib64/libpng15.so.15 (0x00002aaae1915000)
libnvidia-fatbinaryloader.so.390.30 => /cm/local/apps/cuda/libs/current/lib64/libnvidia-fatbinaryloader.so.390.30 (0x00002aaae1b41000)
libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00002aaae1d8d000)
libX11.so.6 => /lib64/libX11.so.6 (0x00002aaae1f92000)
libXi.so.6 => /lib64/libXi.so.6 (0x00002aaae22d0000)
libXfixes.so.3 => /lib64/libXfixes.so.3 (0x00002aaae24e0000)
libatk-bridge-2.0.so.0 => /lib64/libatk-bridge-2.0.so.0 (0x00002aaae26e7000)
libepoxy.so.0 => /lib64/libepoxy.so.0 (0x00002aaae2916000)
libpangoft2-1.0.so.0 => /lib64/libpangoft2-1.0.so.0 (0x00002aaae2c0b000)
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00002aaae2e22000)
libXinerama.so.1 => /lib64/libXinerama.so.1 (0x00002aaae305f000)
libXrandr.so.2 => /lib64/libXrandr.so.2 (0x00002aaae3262000)
libXcursor.so.1 => /lib64/libXcursor.so.1 (0x00002aaae346e000)
libXcomposite.so.1 => /lib64/libXcomposite.so.1 (0x00002aaae3679000)
libXdamage.so.1 => /lib64/libXdamage.so.1 (0x00002aaae387c000)
libXext.so.6 => /lib64/libXext.so.6 (0x00002aaae3a80000)
libffi.so.6 => /lib64/libffi.so.6 (0x00002aaae3c92000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00002aaae3e9a000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00002aaae40fd000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00002aaae4324000)
libmount.so.1 => /lib64/libmount.so.1 (0x00002aaae453e000)
libthai.so.0 => /lib64/libthai.so.0 (0x00002aaae4780000)
libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00002aaae498c000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00002aaae4bef000)
libpixman-1.so.0 => /lib64/libpixman-1.so.0 (0x00002aaae4e96000)
libEGL.so.1 => /cm/local/apps/cuda/libs/current/lib64/libEGL.so.1 (0x00002aaae513f000)
libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x00002aaae5351000)
libxcb.so.1 => /lib64/libxcb.so.1 (0x00002aaae5556000)
libxcb-render.so.0 => /lib64/libxcb-render.so.0 (0x00002aaae577e000)
libXrender.so.1 => /lib64/libXrender.so.1 (0x00002aaae598c000)
libGL.so.1 => /cm/local/apps/cuda/libs/current/lib64/libGL.so.1 (0x00002aaae5b98000)
libcap.so.2 => /lib64/libcap.so.2 (0x00002aaae5e3c000)
libdw.so.1 => /lib64/libdw.so.1 (0x00002aaae6042000)
libatspi.so.0 => /lib64/libatspi.so.0 (0x00002aaae6289000)
libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00002aaae64ba000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00002aaae6702000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00002aaae692d000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00002aaae6b6c000)
libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00002aaae6d71000)
libGLdispatch.so.0 => /cm/local/apps/cuda/libs/current/lib64/libGLdispatch.so.0 (0x00002aaae6fa0000)
libXau.so.6 => /lib64/libXau.so.6 (0x00002aaae726e000)
libGLX.so.0 => /cm/local/apps/cuda/libs/current/lib64/libGLX.so.0 (0x00002aaae7473000)
libattr.so.1 => /lib64/libattr.so.1 (0x00002aaae76a3000)
libelf.so.1 => /lib64/libelf.so.1 (0x00002aaae78a8000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00002aaae7ac0000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00002aaae7ce7000)

How can I tackle this problem? Thanks very much!