1.error while loading shared libraries: libc10_cuda.so: cannot open shared object file: No such file or directory
解决方案
当执行函数动态链接.so时,如果此文件不在缺省目录下 /lib和/usr/lib,那么就需要指定环境变量LD_LIBRARY_PATH 假如现在需要在已有的环境变量上添加新的路径名,则采用如下方式: LD_LIBRARY_PATH=NEWDIRS:$LD_LIBRARY_PATH (newdirs是新的路径串), 实例如下
export LD_LIBRARY_PATH=/opt/libtorch-cxx11-abi-shared-with-deps-1.5.0/libtorch/lib/:$LD_LIBRARY_PATH