文章目录
- 参考文献
- 创建环境
- 在(zgp_m3dm)中安装会显示zgp_m3dm_main环境中的情况满足
- (base) ~/zgp/M3DM-repetition conda deactivate
- 再次安装
- 如果服务器本身不能联网,需下载pysocks包以设置反向代理(具体可参考之前的笔记10):
- 再次(zgp_m3dm) ~/zgp/M3DM-repetition (master ✔) pip install -r requirement.txt
- pip install --upgrade https://github.com/unlimblue/KNN_CUDA/releases/download/0.2/KNN_CUDA-0.2-py3-none-any.whl
- pip install "git+http://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib"
- conda install matplotlib
- pip install pandas
- 报错
- 清理删除上一个环境conda remove --name zgp_m3dm_main --all导致需要再配gcc相关环境
- 虚拟环境中装gcc conda install -c moussi gcc_impl_linux-64=8.4.0
- 继续对应装相同版本conda install -c moussi gxx_impl_linux-64=8.4.0
- 软连接(没成功)
- 建立自己的软连接
- 报错ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/PIL/../../.././libLerc.so)
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./home/cszx/miniconda3/envs/zgp_m3dm/lib(不行
- vim ~/.zshrc(可以)
参考文献
《Multimodal Industrial Anomaly Detection via Hybrid Fusion》论文学习及代码复现
AttributeError: module ‘distutils‘ has no attribute ‘version‘解决跑pytorch代码报错
创建环境
conda create -n zgp_m3dm python=3.8
Package Plan
environment location: /home/cszx/miniconda3/envs/zgp_m3dm
added / updated specs:
- python=3.8
The following NEW packages will be INSTALLED:
_libgcc_mutex pkgs/main/linux-64::_libgcc_mutex-0.1-main
_openmp_mutex pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu
ca-certificates pkgs/main/linux-64::ca-certificates-2024.3.11-h06a4308_0
ld_impl_linux-64 pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1
libffi pkgs/main/linux-64::libffi-3.4.4-h6a678d5_1
libgcc-ng pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1
libgomp pkgs/main/linux-64::libgomp-11.2.0-h1234567_1
libstdcxx-ng pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1
ncurses pkgs/main/linux-64::ncurses-6.4-h6a678d5_0
openssl pkgs/main/linux-64::openssl-3.0.13-h7f8727e_2
pip pkgs/main/linux-64::pip-24.0-py38h06a4308_0
python pkgs/main/linux-64::python-3.8.19-h955ad1f_0
readline pkgs/main/linux-64::readline-8.2-h5eee18b_0
setuptools pkgs/main/linux-64::setuptools-69.5.1-py38h06a4308_0
sqlite pkgs/main/linux-64::sqlite-3.45.3-h5eee18b_0
tk pkgs/main/linux-64::tk-8.6.14-h39e8969_0
wheel pkgs/main/linux-64::wheel-0.43.0-py38h06a4308_0
xz pkgs/main/linux-64::xz-5.4.6-h5eee18b_1
zlib pkgs/main/linux-64::zlib-1.2.13-h5eee18b_1
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate zgp_m3dm
#
# To deactivate an active environment, use
#
# $ conda deactivate
参考《Multimodal Industrial Anomaly Detection via Hybrid Fusion》论文学习及代码复现发现
(zgp_m3dm) ~/zgp/M3DM-repetition pip install -r requirement.txt
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: numpy in /home/cszx/miniconda3/envs/zgp_m3dm_main/lib/python3.8/site-packages (from -r requirement.txt (line 1)) (1.24.4)
Requirement already satisfied: Pillow in /home/cszx/miniconda3/envs/zgp_m3dm_main/lib/python3.8/site-packages (from -r requirement.txt (line 2)) (10.3.0)
Requirement already satisfied: scikit-learn in /home/cszx/miniconda3/envs/zgp_m3dm_main/lib/python3.8/site-packages (from -r requirement.txt (line 3)) (1.3.2)
在(zgp_m3dm)中安装会显示zgp_m3dm_main环境中的情况满足
(zgp_m3dm) ~/zgp/M3DM-repetition conda deactivate
(base) ~/zgp/M3DM-repetition conda deactivate
~/zgp/M3DM-repetition conda activate zgp_m3dm
再次安装
(zgp_m3dm) ~/zgp/M3DM-repetition pip install -r requirement.txt
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.
WARNING: There was an error checking the latest version of pip.
如果服务器本身不能联网,需下载pysocks包以设置反向代理(具体可参考之前的笔记10):
首先,在base环境将需要的pysocks包下载下来,
(base) ~ git clone https://gitcode.com/Anorov/PySocks.git
之后进入新虚拟环境中执行安装,
~/PySocks (master ✔) conda activate zgp_shape
(zgp_shape) ~/PySocks (master ✔) python setup.py install
(zgp_m3dm) ~/PySocks (master ✔) python setup.py install
Warning: 'classifiers' should be a list, got type 'tuple'
running install
/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
self.initialize_options()
running bdist_egg
running egg_info
writing PySocks.egg-info/PKG-INFO
writing dependency_links to PySocks.egg-info/dependency_links.txt
writing top-level names to PySocks.egg-info/top_level.txt
reading manifest file 'PySocks.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'PySocks.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying socks.py -> build/lib
copying sockshandler.py -> build/lib
creating build/bdist.linux-x86_64/egg
copying build/lib/socks.py -> build/bdist.linux-x86_64/egg
copying build/lib/sockshandler.py -> build/bdist.linux-x86_64/egg
byte-compiling build/bdist.linux-x86_64/egg/socks.py to socks.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/sockshandler.py to sockshandler.cpython-38.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying PySocks.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PySocks.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PySocks.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying PySocks.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/PySocks-1.7.1-py3.8.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing PySocks-1.7.1-py3.8.egg
Copying PySocks-1.7.1-py3.8.egg to /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages
Adding PySocks 1.7.1 to easy-install.pth file
Installed /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/PySocks-1.7.1-py3.8.egg
Processing dependencies for PySocks==1.7.1
Finished processing dependencies for PySocks==1.7.1
export http_proxy=“socks5h://127.0.0.1:8080”
export https_proxy=“socks5h://127.0.0.1:8080”
再次(zgp_m3dm) ~/zgp/M3DM-repetition (master ✔) pip install -r requirement.txt
Installing collected packages: wget, mpmath, zipp, urllib3, typing-extensions, tqdm, threadpoolctl, tensorboard-data-server, sympy, setuptools, safetensors, pyyaml, pyasn1, protobuf, Pillow, packaging, oauthlib, nvidia-nvtx-cu12, nvidia-nvjitlink-cu12, nvidia-nccl-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, numpy, networkx, MarkupSafe, kornia-rs, joblib, idna, grpcio, fsspec, filelock, charset-normalizer, certifi, cachetools, absl-py, werkzeug, triton, tifffile, scipy, rsa, requests, PyWavelets, pyasn1-modules, opencv-python, nvidia-cusparse-cu12, nvidia-cudnn-cu12, lazy_loader, jinja2, importlib-metadata, imageio, scikit-learn, scikit-image, requests-oauthlib, nvidia-cusolver-cu12, markdown, huggingface_hub, google-auth, torch, google-auth-oauthlib, torchvision, tensorboard, kornia, timm
Attempting uninstall: setuptools
Found existing installation: setuptools 69.5.1
Uninstalling setuptools-69.5.1:
Successfully uninstalled setuptools-69.5.1
Successfully installed MarkupSafe-2.1.5 Pillow-10.3.0 PyWavelets-1.4.1 absl-py-2.1.0 cachetools-5.3.3 certifi-2024.2.2 charset-normalizer-3.3.2 filelock-3.14.0 fsspec-2024.5.0 google-auth-2.29.0 google-auth-oauthlib-1.0.0 grpcio-1.64.0 huggingface_hub-0.23.2 idna-3.7 imageio-2.34.1 importlib-metadata-7.1.0 jinja2-3.1.4 joblib-1.4.2 kornia-0.7.2 kornia-rs-0.1.3 lazy_loader-0.4 markdown-3.6 mpmath-1.3.0 networkx-3.1 numpy-1.24.4 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.5.40 nvidia-nvtx-cu12-12.1.105 oauthlib-3.2.2 opencv-python-4.9.0.80 packaging-24.0 protobuf-5.27.0 pyasn1-0.6.0 pyasn1-modules-0.4.0 pyyaml-6.0.1 requests-2.32.2 requests-oauthlib-2.0.0 rsa-4.9 safetensors-0.4.3 scikit-image-0.21.0 scikit-learn-1.3.2 scipy-1.10.1 setuptools-59.5.0 sympy-1.12 tensorboard-2.14.0 tensorboard-data-server-0.7.2 threadpoolctl-3.5.0 tifffile-2023.7.10 timm-1.0.3 torch-2.3.0 torchvision-0.18.0 tqdm-4.66.4 triton-2.3.0 typing-extensions-4.12.0 urllib3-2.2.1 werkzeug-3.0.3 wget-3.2 zipp-3.19.0
```
安装的版本新,降低torch
pip install torch1.10.0+cu113 torchvision0.11.1+cu113 torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 -i https://pypi.tuna.tsinghua.edu.cn/simple
Collecting torch==1.10.0+cu113
Using cached https://download.pytorch.org/whl/cu113/torch-1.10.0%2Bcu113-cp38-cp38-linux_x86_64.whl (1821.4 MB)
Collecting torchvision==0.11.1+cu113
Using cached https://download.pytorch.org/whl/cu113/torchvision-0.11.1%2Bcu113-cp38-cp38-linux_x86_64.whl (24.6 MB)
Collecting torchaudio
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d9/b1/91b6dd40186ba718419786d0c1f4e4a0216dde67ed6b114cea85cbaf1317/torchaudio-2.3.0-cp38-cp38-manylinux1_x86_64.whl (3.3 MB)
Requirement already satisfied: typing-extensions in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from torch==1.10.0+cu113) (4.12.0)
Requirement already satisfied: numpy in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from torchvision==0.11.1+cu113) (1.24.4)
Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from torchvision==0.11.1+cu113) (10.3.0)
INFO: pip is looking at multiple versions of torchaudio to determine which version is compatible with other requirements. This could take a while.
Installing collected packages: torch, torchvision, torchaudio
Attempting uninstall: torch
Found existing installation: torch 2.3.0
Uninstalling torch-2.3.0:
Successfully uninstalled torch-2.3.0
Attempting uninstall: torchvision
Found existing installation: torchvision 0.18.0
Uninstalling torchvision-0.18.0:
Successfully uninstalled torchvision-0.18.0
Successfully installed torch-1.10.0+cu113 torchaudio-0.10.0+cu113 torchvision-0.11.1+cu113
pip install --upgrade https://github.com/unlimblue/KNN_CUDA/releases/download/0.2/KNN_CUDA-0.2-py3-none-any.whl
Collecting KNN-CUDA==0.2
Downloading https://github.com/unlimblue/KNN_CUDA/releases/download/0.2/KNN_CUDA-0.2-py3-none-any.whl (5.7 kB)
Requirement already satisfied: numpy in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from KNN-CUDA==0.2) (1.24.4)
Requirement already satisfied: scikit-learn in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from KNN-CUDA==0.2) (1.3.2)
Requirement already satisfied: torch>=1.1.0 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from KNN-CUDA==0.2) (1.10.0+cu113)
Requirement already satisfied: typing-extensions in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from torch>=1.1.0->KNN-CUDA==0.2) (4.12.0)
Requirement already satisfied: scipy>=1.5.0 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from scikit-learn->KNN-CUDA==0.2) (1.10.1)
Requirement already satisfied: joblib>=1.1.1 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from scikit-learn->KNN-CUDA==0.2) (1.4.2)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from scikit-learn->KNN-CUDA==0.2) (3.5.0)
Installing collected packages: KNN-CUDA
Successfully installed KNN-CUDA-0.2
pip install “git+http://github.com/erikwijmans/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib”
Requirement already satisfied: torch>=1.4 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from pointnet2_ops) (1.10.0+cu113)
Requirement already satisfied: typing-extensions in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from torch>=1.4->pointnet2_ops) (4.12.0)
Building wheels for collected packages: pointnet2_ops
Building wheel for pointnet2_ops (setup.py) ... done
Created wheel for pointnet2_ops: filename=pointnet2_ops-3.0.0-cp38-cp38-linux_x86_64.whl size=6389382 sha256=ecd25151aee1e80c144aa09de0aa629f6e4912109c7f29a613719a770f74310d
Stored in directory: /tmp/pip-ephem-wheel-cache-is3ew51v/wheels/81/9b/50/afb7a8c2bd3bde2aad89a6e36f246af0015230a65eca33ae92
Successfully built pointnet2_ops
Installing collected packages: pointnet2_ops
Successfully installed pointnet2_ops-3.0.0
conda install matplotlib
Package Plan
environment location: /home/cszx/miniconda3/envs/zgp_m3dm
added / updated specs:
- matplotlib
The following NEW packages will be INSTALLED:
blas pkgs/main/linux-64::blas-1.0-mkl
brotli pkgs/main/linux-64::brotli-1.0.9-h5eee18b_8
brotli-bin pkgs/main/linux-64::brotli-bin-1.0.9-h5eee18b_8
bzip2 pkgs/main/linux-64::bzip2-1.0.8-h5eee18b_6
contourpy pkgs/main/linux-64::contourpy-1.0.5-py38hdb19cb5_0
cycler pkgs/main/noarch::cycler-0.11.0-pyhd3eb1b0_0
cyrus-sasl pkgs/main/linux-64::cyrus-sasl-2.1.28-h52b45da_1
dbus pkgs/main/linux-64::dbus-1.13.18-hb2f20db_0
expat pkgs/main/linux-64::expat-2.6.2-h6a678d5_0
fontconfig pkgs/main/linux-64::fontconfig-2.14.1-h4c34cd2_2
fonttools pkgs/main/linux-64::fonttools-4.51.0-py38h5eee18b_0
freetype pkgs/main/linux-64::freetype-2.12.1-h4a9f257_0
glib pkgs/main/linux-64::glib-2.78.4-h6a678d5_0
glib-tools pkgs/main/linux-64::glib-tools-2.78.4-h6a678d5_0
gst-plugins-base pkgs/main/linux-64::gst-plugins-base-1.14.1-h6a678d5_1
gstreamer pkgs/main/linux-64::gstreamer-1.14.1-h5eee18b_1
icu pkgs/main/linux-64::icu-73.1-h6a678d5_0
importlib_resourc~ pkgs/main/linux-64::importlib_resources-6.1.1-py38h06a4308_1
intel-openmp pkgs/main/linux-64::intel-openmp-2023.1.0-hdb19cb5_46306
jpeg pkgs/main/linux-64::jpeg-9e-h5eee18b_1
kiwisolver pkgs/main/linux-64::kiwisolver-1.4.4-py38h6a678d5_0
krb5 pkgs/main/linux-64::krb5-1.20.1-h143b758_1
lcms2 pkgs/main/linux-64::lcms2-2.12-h3be6417_0
lerc pkgs/main/linux-64::lerc-3.0-h295c915_0
libbrotlicommon pkgs/main/linux-64::libbrotlicommon-1.0.9-h5eee18b_8
libbrotlidec pkgs/main/linux-64::libbrotlidec-1.0.9-h5eee18b_8
libbrotlienc pkgs/main/linux-64::libbrotlienc-1.0.9-h5eee18b_8
libclang pkgs/main/linux-64::libclang-14.0.6-default_hc6dbbc7_1
libclang13 pkgs/main/linux-64::libclang13-14.0.6-default_he11475f_1
libcups pkgs/main/linux-64::libcups-2.4.2-h2d74bed_1
libdeflate pkgs/main/linux-64::libdeflate-1.17-h5eee18b_1
libedit pkgs/main/linux-64::libedit-3.1.20230828-h5eee18b_0
libglib pkgs/main/linux-64::libglib-2.78.4-hdc74915_0
libiconv pkgs/main/linux-64::libiconv-1.16-h5eee18b_3
libllvm14 pkgs/main/linux-64::libllvm14-14.0.6-hdb19cb5_3
libpng pkgs/main/linux-64::libpng-1.6.39-h5eee18b_0
libpq pkgs/main/linux-64::libpq-12.17-hdbd6064_0
libtiff pkgs/main/linux-64::libtiff-4.5.1-h6a678d5_0
libuuid pkgs/main/linux-64::libuuid-1.41.5-h5eee18b_0
libwebp-base pkgs/main/linux-64::libwebp-base-1.3.2-h5eee18b_0
libxcb pkgs/main/linux-64::libxcb-1.15-h7f8727e_0
libxkbcommon pkgs/main/linux-64::libxkbcommon-1.0.1-h5eee18b_1
libxml2 pkgs/main/linux-64::libxml2-2.10.4-hfdd30dd_2
lz4-c pkgs/main/linux-64::lz4-c-1.9.4-h6a678d5_1
matplotlib pkgs/main/linux-64::matplotlib-3.7.2-py38h06a4308_0
matplotlib-base pkgs/main/linux-64::matplotlib-base-3.7.2-py38h1128e8f_0
mkl pkgs/main/linux-64::mkl-2023.1.0-h213fc3f_46344
mkl-service pkgs/main/linux-64::mkl-service-2.4.0-py38h5eee18b_1
mkl_fft pkgs/main/linux-64::mkl_fft-1.3.8-py38h5eee18b_0
mkl_random pkgs/main/linux-64::mkl_random-1.2.4-py38hdb19cb5_0
mysql pkgs/main/linux-64::mysql-5.7.24-h721c034_2
numpy pkgs/main/linux-64::numpy-1.24.3-py38hf6e8229_1
numpy-base pkgs/main/linux-64::numpy-base-1.24.3-py38h060ed82_1
openjpeg pkgs/main/linux-64::openjpeg-2.4.0-h3ad879b_0
packaging pkgs/main/linux-64::packaging-23.2-py38h06a4308_0
pcre2 pkgs/main/linux-64::pcre2-10.42-hebb0a14_1
pillow pkgs/main/linux-64::pillow-10.3.0-py38h5eee18b_0
ply pkgs/main/linux-64::ply-3.11-py38_0
pyparsing pkgs/main/linux-64::pyparsing-3.0.9-py38h06a4308_0
pyqt pkgs/main/linux-64::pyqt-5.15.10-py38h6a678d5_0
pyqt5-sip pkgs/main/linux-64::pyqt5-sip-12.13.0-py38h5eee18b_0
python-dateutil pkgs/main/linux-64::python-dateutil-2.9.0post0-py38h06a4308_2
qt-main pkgs/main/linux-64::qt-main-5.15.2-h53bd1ea_10
setuptools pkgs/main/linux-64::setuptools-69.5.1-py38h06a4308_0
sip pkgs/main/linux-64::sip-6.7.12-py38h6a678d5_0
six pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1
tbb pkgs/main/linux-64::tbb-2021.8.0-hdb19cb5_0
tomli pkgs/main/linux-64::tomli-2.0.1-py38h06a4308_0
tornado pkgs/main/linux-64::tornado-6.3.3-py38h5eee18b_0
unicodedata2 pkgs/main/linux-64::unicodedata2-15.1.0-py38h5eee18b_0
zipp pkgs/main/linux-64::zipp-3.17.0-py38h06a4308_0
zstd pkgs/main/linux-64::zstd-1.5.5-hc292b87_2
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
pip install pandas
Collecting pandas
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f8/7f/5b047effafbdd34e52c9e2d7e44f729a0655efafb22198c45cf692cdc157/pandas-2.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from pandas) (2.9.0.post0)
Collecting pytz>=2020.1 (from pandas)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9c/3d/a121f284241f08268b21359bd425f7d4825cffc5ac5cd0e1b3d82ffd2b10/pytz-2024.1-py2.py3-none-any.whl (505 kB)
Collecting tzdata>=2022.1 (from pandas)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/65/58/f9c9e6be752e9fcb8b6a0ee9fb87e6e7a1f6bcab2cdc73f02bb7ba91ada0/tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Requirement already satisfied: numpy>=1.20.3 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from pandas) (1.24.3)
Requirement already satisfied: six>=1.5 in /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)
Installing collected packages: pytz, tzdata, pandas
Successfully installed pandas-2.0.3 pytz-2024.1 tzdata-2024.1
(zgp_m3dm) ~/zgp/M3DM-repetition (master ✔) conda list
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
absl-py 2.1.0 pypi_0 pypi
blas 1.0 mkl
brotli 1.0.9 h5eee18b_8
brotli-bin 1.0.9 h5eee18b_8
bzip2 1.0.8 h5eee18b_6
ca-certificates 2024.3.11 h06a4308_0
cachetools 5.3.3 pypi_0 pypi
certifi 2024.2.2 pypi_0 pypi
charset-normalizer 3.3.2 pypi_0 pypi
contourpy 1.0.5 py38hdb19cb5_0
cycler 0.11.0 pyhd3eb1b0_0
cyrus-sasl 2.1.28 h52b45da_1
dbus 1.13.18 hb2f20db_0
expat 2.6.2 h6a678d5_0
filelock 3.14.0 pypi_0 pypi
fontconfig 2.14.1 h4c34cd2_2
fonttools 4.51.0 py38h5eee18b_0
freetype 2.12.1 h4a9f257_0
fsspec 2024.5.0 pypi_0 pypi
glib 2.78.4 h6a678d5_0
glib-tools 2.78.4 h6a678d5_0
google-auth 2.29.0 pypi_0 pypi
google-auth-oauthlib 1.0.0 pypi_0 pypi
grpcio 1.64.0 pypi_0 pypi
gst-plugins-base 1.14.1 h6a678d5_1
gstreamer 1.14.1 h5eee18b_1
huggingface-hub 0.23.2 pypi_0 pypi
icu 73.1 h6a678d5_0
idna 3.7 pypi_0 pypi
imageio 2.34.1 pypi_0 pypi
importlib-metadata 7.1.0 pypi_0 pypi
importlib_resources 6.1.1 py38h06a4308_1
intel-openmp 2023.1.0 hdb19cb5_46306
jinja2 3.1.4 pypi_0 pypi
joblib 1.4.2 pypi_0 pypi
jpeg 9e h5eee18b_1
kiwisolver 1.4.4 py38h6a678d5_0
knn-cuda 0.2 pypi_0 pypi
kornia 0.7.2 pypi_0 pypi
kornia-rs 0.1.3 pypi_0 pypi
krb5 1.20.1 h143b758_1
lazy-loader 0.4 pypi_0 pypi
lcms2 2.12 h3be6417_0
ld_impl_linux-64 2.38 h1181459_1
lerc 3.0 h295c915_0
libbrotlicommon 1.0.9 h5eee18b_8
libbrotlidec 1.0.9 h5eee18b_8
libbrotlienc 1.0.9 h5eee18b_8
libclang 14.0.6 default_hc6dbbc7_1
libclang13 14.0.6 default_he11475f_1
libcups 2.4.2 h2d74bed_1
libdeflate 1.17 h5eee18b_1
libedit 3.1.20230828 h5eee18b_0
libffi 3.4.4 h6a678d5_1
libgcc-ng 11.2.0 h1234567_1
libglib 2.78.4 hdc74915_0
libgomp 11.2.0 h1234567_1
libiconv 1.16 h5eee18b_3
libllvm14 14.0.6 hdb19cb5_3
libpng 1.6.39 h5eee18b_0
libpq 12.17 hdbd6064_0
libstdcxx-ng 11.2.0 h1234567_1
libtiff 4.5.1 h6a678d5_0
libuuid 1.41.5 h5eee18b_0
libwebp-base 1.3.2 h5eee18b_0
libxcb 1.15 h7f8727e_0
libxkbcommon 1.0.1 h5eee18b_1
libxml2 2.10.4 hfdd30dd_2
lz4-c 1.9.4 h6a678d5_1
markdown 3.6 pypi_0 pypi
markupsafe 2.1.5 pypi_0 pypi
matplotlib 3.7.2 py38h06a4308_0
matplotlib-base 3.7.2 py38h1128e8f_0
mkl 2023.1.0 h213fc3f_46344
mkl-service 2.4.0 py38h5eee18b_1
mkl_fft 1.3.8 py38h5eee18b_0
mkl_random 1.2.4 py38hdb19cb5_0
mpmath 1.3.0 pypi_0 pypi
mysql 5.7.24 h721c034_2
ncurses 6.4 h6a678d5_0
networkx 3.1 pypi_0 pypi
numpy 1.24.4 pypi_0 pypi
numpy-base 1.24.3 py38h060ed82_1
nvidia-cublas-cu12 12.1.3.1 pypi_0 pypi
nvidia-cuda-cupti-cu12 12.1.105 pypi_0 pypi
nvidia-cuda-nvrtc-cu12 12.1.105 pypi_0 pypi
nvidia-cuda-runtime-cu12 12.1.105 pypi_0 pypi
nvidia-cudnn-cu12 8.9.2.26 pypi_0 pypi
nvidia-cufft-cu12 11.0.2.54 pypi_0 pypi
nvidia-curand-cu12 10.3.2.106 pypi_0 pypi
nvidia-cusolver-cu12 11.4.5.107 pypi_0 pypi
nvidia-cusparse-cu12 12.1.0.106 pypi_0 pypi
nvidia-nccl-cu12 2.20.5 pypi_0 pypi
nvidia-nvjitlink-cu12 12.5.40 pypi_0 pypi
nvidia-nvtx-cu12 12.1.105 pypi_0 pypi
oauthlib 3.2.2 pypi_0 pypi
opencv-python 4.9.0.80 pypi_0 pypi
openjpeg 2.4.0 h3ad879b_0
openssl 3.0.13 h7f8727e_2
packaging 24.0 pypi_0 pypi
pandas 2.0.3 pypi_0 pypi
pcre2 10.42 hebb0a14_1
pillow 10.3.0 py38h5eee18b_0
pip 24.0 py38h06a4308_0
ply 3.11 py38_0
pointnet2-ops 3.0.0 pypi_0 pypi
protobuf 5.27.0 pypi_0 pypi
pyasn1 0.6.0 pypi_0 pypi
pyasn1-modules 0.4.0 pypi_0 pypi
pyparsing 3.0.9 py38h06a4308_0
pyqt 5.15.10 py38h6a678d5_0
pyqt5-sip 12.13.0 py38h5eee18b_0
python 3.8.19 h955ad1f_0
python-dateutil 2.9.0post0 py38h06a4308_2
pytz 2024.1 pypi_0 pypi
pywavelets 1.4.1 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
qt-main 5.15.2 h53bd1ea_10
readline 8.2 h5eee18b_0
requests 2.32.2 pypi_0 pypi
requests-oauthlib 2.0.0 pypi_0 pypi
rsa 4.9 pypi_0 pypi
safetensors 0.4.3 pypi_0 pypi
scikit-image 0.21.0 pypi_0 pypi
scikit-learn 1.3.2 pypi_0 pypi
scipy 1.10.1 pypi_0 pypi
setuptools 59.5.0 pypi_0 pypi
sip 6.7.12 py38h6a678d5_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.45.3 h5eee18b_0
sympy 1.12 pypi_0 pypi
tbb 2021.8.0 hdb19cb5_0
tensorboard 2.14.0 pypi_0 pypi
tensorboard-data-server 0.7.2 pypi_0 pypi
threadpoolctl 3.5.0 pypi_0 pypi
tifffile 2023.7.10 pypi_0 pypi
timm 1.0.3 pypi_0 pypi
tk 8.6.14 h39e8969_0
tomli 2.0.1 py38h06a4308_0
torch 1.10.0+cu113 pypi_0 pypi
torchaudio 0.10.0+cu113 pypi_0 pypi
torchvision 0.11.1+cu113 pypi_0 pypi
tornado 6.3.3 py38h5eee18b_0
tqdm 4.66.4 pypi_0 pypi
triton 2.3.0 pypi_0 pypi
typing-extensions 4.12.0 pypi_0 pypi
tzdata 2024.1 pypi_0 pypi
unicodedata2 15.1.0 py38h5eee18b_0
urllib3 2.2.1 pypi_0 pypi
werkzeug 3.0.3 pypi_0 pypi
wget 3.2 pypi_0 pypi
wheel 0.43.0 py38h06a4308_0
xz 5.4.6 h5eee18b_1
zipp 3.19.0 pypi_0 pypi
zlib 1.2.13 h5eee18b_1
zstd 1.5.5 hc292b87_2
报错
Traceback (most recent call last):
File “fusion_pretrain.py”, line 11, in
from torch.utils.tensorboard import SummaryWriter
File “/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/torch/utils/tensorboard/init.py”, line 4, in
LooseVersion = distutils.version.LooseVersion
AttributeError: module ‘distutils’ has no attribute ‘version’
和修复环境zgp_m3dm_main时报错一样,决定不改环境了, 改代码,参考AttributeError: module ‘distutils‘ has no attribute ‘version‘解决跑pytorch代码报错
找到 /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/torch/utils/tensorboard/init.py
注释掉四行,远程服务器文件
#LooseVersion = distutils.version.LooseVersion
#if not hasattr(tensorboard, '__version__') or LooseVersion(tensorboard.__version__) < LooseVersion('1.15'):
# raise ImportError('TensorBoard logging requires TensorBoard version 1.15 or above')
del distutils
#del LooseVersion
可以了。
清理删除上一个环境conda remove --name zgp_m3dm_main --all导致需要再配gcc相关环境
~/zgp/M3DM-repetition (master ✔) conda remove --name zgp_m3dm_main --all
Remove all packages in environment /home/cszx/miniconda3/envs/zgp_m3dm_main:
## Package Plan ##
environment location: /home/cszx/miniconda3/envs/zgp_m3dm_main
The following packages will be REMOVED:
_libgcc_mutex-0.1-main
_openmp_mutex-5.1-1_gnu
_sysroot_linux-64_curr_repodata_hack-3-haa98f57_10
binutils_impl_linux-64-2.38-h2a08ee3_1
blas-1.0-mkl
brotli-1.0.9-h5eee18b_8
brotli-bin-1.0.9-h5eee18b_8
bzip2-1.0.8-h5eee18b_6
ca-certificates-2024.3.11-h06a4308_0
contourpy-1.0.5-py38hdb19cb5_0
cudatoolkit-11.3.1-h2bc3f7f_2
cycler-0.11.0-pyhd3eb1b0_0
cyrus-sasl-2.1.28-h52b45da_1
dbus-1.13.18-hb2f20db_0
expat-2.6.2-h6a678d5_0
fontconfig-2.14.1-h4c34cd2_2
fonttools-4.51.0-py38h5eee18b_0
freetype-2.12.1-h4a9f257_0
gcc_impl_linux-64-8.4.0-he7ac559_17
glib-2.78.4-h6a678d5_0
glib-tools-2.78.4-h6a678d5_0
gst-plugins-base-1.14.1-h6a678d5_1
gstreamer-1.14.1-h5eee18b_1
gxx_impl_linux-64-8.4.0-h9ce2e92_17
icu-73.1-h6a678d5_0
importlib_resources-6.1.1-py38h06a4308_1
intel-openmp-2023.1.0-hdb19cb5_46306
jpeg-9e-h5eee18b_1
kernel-headers_linux-64-3.10.0-h57e8cba_10
kiwisolver-1.4.4-py38h6a678d5_0
krb5-1.20.1-h143b758_1
lcms2-2.12-h3be6417_0
ld_impl_linux-64-2.38-h1181459_1
lerc-3.0-h295c915_0
libbrotlicommon-1.0.9-h5eee18b_8
libbrotlidec-1.0.9-h5eee18b_8
libbrotlienc-1.0.9-h5eee18b_8
libclang-14.0.6-default_hc6dbbc7_1
libclang13-14.0.6-default_he11475f_1
libcups-2.4.2-h2d74bed_1
libdeflate-1.17-h5eee18b_1
libedit-3.1.20230828-h5eee18b_0
libffi-3.4.4-h6a678d5_0
libgcc-devel_linux-64-8.4.0-hd257e2f_17
libgcc-ng-11.2.0-h1234567_1
libglib-2.78.4-hdc74915_0
libgomp-11.2.0-h1234567_1
libiconv-1.16-h5eee18b_3
libllvm14-14.0.6-hdb19cb5_3
libpng-1.6.39-h5eee18b_0
libpq-12.17-hdbd6064_0
libprotobuf-3.20.3-he621ea3_0
libstdcxx-devel_linux-64-8.4.0-hf0c5c8d_17
libstdcxx-ng-11.2.0-h1234567_1
libtiff-4.5.1-h6a678d5_0
libuuid-1.41.5-h5eee18b_0
libwebp-base-1.3.2-h5eee18b_0
libxcb-1.15-h7f8727e_0
libxkbcommon-1.0.1-h5eee18b_1
libxml2-2.10.4-hfdd30dd_2
lz4-c-1.9.4-h6a678d5_0
matplotlib-3.7.2-py38h06a4308_0
matplotlib-base-3.7.2-py38h1128e8f_0
mkl-2023.1.0-h213fc3f_46344
mkl-service-2.4.0-py38h5eee18b_1
mkl_fft-1.3.8-py38h5eee18b_0
mkl_random-1.2.4-py38hdb19cb5_0
mysql-5.7.24-h721c034_2
ncurses-6.4-h6a678d5_0
numpy-1.24.3-py38hf6e8229_1
openjpeg-2.4.0-h3ad879b_0
openssl-3.0.13-h7f8727e_2
packaging-23.2-py38h06a4308_0
pcre2-10.42-hebb0a14_1
pillow-10.3.0-py38h5eee18b_0
pip-23.3.1-py38h06a4308_0
ply-3.11-py38_0
protobuf-3.20.3-py38h6a678d5_0
pyparsing-3.0.9-py38h06a4308_0
pyqt-5.15.10-py38h6a678d5_0
pyqt5-sip-12.13.0-py38h5eee18b_0
python-3.8.19-h955ad1f_0
python-dateutil-2.9.0post0-py38h06a4308_2
qt-main-5.15.2-h53bd1ea_10
readline-8.2-h5eee18b_0
setuptools-69.5.1-py38h06a4308_0
sip-6.7.12-py38h6a678d5_0
six-1.16.0-pyhd3eb1b0_1
sqlite-3.41.2-h5eee18b_0
sysroot_linux-64-2.17-h57e8cba_10
tbb-2021.8.0-hdb19cb5_0
tk-8.6.12-h1ccaba5_0
tomli-2.0.1-py38h06a4308_0
tornado-6.3.3-py38h5eee18b_0
unicodedata2-15.1.0-py38h5eee18b_0
wheel-0.41.2-py38h06a4308_0
xz-5.4.6-h5eee18b_0
zipp-3.17.0-py38h06a4308_0
zlib-1.2.13-h5eee18b_0
zstd-1.5.5-hc292b87_0
Proceed ([y]/n)? y
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
报错了 File “/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/torchvision/init.py”, line 7, in
from torchvision import datasets
File “/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/torchvision/datasets/init.py”, line 1, in
from .lsun import LSUN, LSUNClass
File “/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/torchvision/datasets/lsun.py”, line 2, in
from PIL import Image
File “/home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/PIL/Image.py”, line 88, in
from . import _imaging as core
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9’ not found (required by /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/PIL/…/…/…/./libLerc.so)
虚拟环境中装gcc conda install -c moussi gcc_impl_linux-64=8.4.0
Total: 12 KB
The following NEW packages will be INSTALLED:
_sysroot_linux-64~ pkgs/main/noarch::_sysroot_linux-64_curr_repodata_hack-3-haa98f57_10
binutils_impl_lin~ pkgs/main/linux-64::binutils_impl_linux-64-2.38-h2a08ee3_1
gcc_impl_linux-64 pkgs/main/linux-64::gcc_impl_linux-64-8.4.0-he7ac559_17
kernel-headers_li~ pkgs/main/noarch::kernel-headers_linux-64-3.10.0-h57e8cba_10
libgcc-devel_linu~ pkgs/main/linux-64::libgcc-devel_linux-64-8.4.0-hd257e2f_17
sysroot_linux-64 pkgs/main/noarch::sysroot_linux-64-2.17-h57e8cba_10
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
继续对应装相同版本conda install -c moussi gxx_impl_linux-64=8.4.0
The following NEW packages will be INSTALLED:
gxx_impl_linux-64 pkgs/main/linux-64::gxx_impl_linux-64-8.4.0-h9ce2e92_17
libstdcxx-devel_l~ pkgs/main/linux-64::libstdcxx-devel_linux-64-8.4.0-hf0c5c8d_17
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
软连接(没成功)
ImportError: /lib64/libstdc++.so.6: version CXXABI_1.3.9' not found (required by /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/PIL/../../.././libLerc.so) (zgp_m3dm) ~/zgp/M3DM-repetition (master ✔) bin=
/home/cszx/miniconda3/envs/zgp_m3dm/bin`
(zgp_m3dm) ~/zgp/M3DM-repetition (master ✔) sudo ln -s ${bin}/x86_64-conda-linux-gnu-cc ${bin}/gcc
[sudo] password for cszx:
ln: failed to create symbolic link ‘/gcc’: File exists
sudo unlink /gcc
(zgp_m3dm) ~/zgp/M3DM-repetition (master ✔) sudo ln -s ${bin}/x86_64-conda-linux-gnu-cc ${bin}/gcc
暂停,也许有创建过,不需要了
建立自己的软连接
ln -s /home/cszx/miniconda3/envs/zgp_m3dm/bin/x86_64-conda-linux-gnu-cc /home/cszx/miniconda3/envs/zgp_m3dm/bin/gcc
ln -s /home/cszx/miniconda3/envs/zgp_m3dm/bin/x86_64-conda-linux-gnu-c++ /home/cszx/miniconda3/envs/zgp_m3dm/bin/g++
重设置环境变量
(zgp_m3dm) ~ export CC=/home/cszx/miniconda3/envs/zgp_m3dm/bin/gcc
(zgp_m3dm) ~ export CXX=/home/cszx/miniconda3/envs/zgp_m3dm/bin/g++
报错ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9’ not found (required by /home/cszx/miniconda3/envs/zgp_m3dm/lib/python3.8/site-packages/PIL/…/…/…/./libLerc.so)
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./home/cszx/miniconda3/envs/zgp_m3dm/lib(不行
vim ~/.zshrc(可以)
zgp_m3dm_main改为zgp_m3dm
(按 x 会删除光标下的单个字符)
export CC=/home/cszx/miniconda3/envs/zgp_m3dm/bin/gcc
export CXX=/home/cszx/miniconda3/envs/zgp_m3dm/bin/g++
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cszx/miniconda3/envs/zgp_m3dm/lib
export PATH=/home/cszx/miniconda3/envs/zgp_m3dm/bin:/home/cszx/miniconda3/envs/zgp_m3dm/lib:$PATH
export PATH=/home/cszx/utils/gcc/bin:$PATH
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
export CUDA_HOME=/usr/local/cuda-11.3
export http_proxy="socks5h://127.0.0.1:8080"
export https_proxy="socks5h://127.0.0.1:8080"
source ~/.zshrc
可以了