查看硬件版本信息
查看當前操作系統發行版信息
cat /etc/issue
查看cpu型號
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
查看物理CPU數
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
查看CPU核數
cat /proc/cpuinfo| grep "cpu cores"| uniq
查看邏輯CPU數
cat /proc/cpuinfo| grep "processor"| wc -l
查看CPU概要信息
lscpu
查看驅動程序信息
查看cuda版本
cuda 版本
cat /usr/local/cuda/version.txt
cudnn 版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
環境下正在使用的cuda版本:
nvcc -V
# or
nvcc -version
Conda和pip使用
1 create a new environment:
conda create -n myname python==x.x
2 delete everything about an environment:
conda remove -n myname --all
3 check all the environments:
conda info -e
4 activate any env:
conda activate myname
5 check package:
conda list
6 search package:
conda search xx
7 install / update / remove / uninstall package
conda install / update xx
8 activate / deactivate env:
conda / source activate env_name
source deactivate env_name
set channel:
check all the chnnels:
conda config --show channels
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- defaults
set qinghua channel:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
pip channel set:
各鏡像源地址:https://www.cnblogs.com/microman/p/6107879.html
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
國內源:
阿里雲 https://mirrors.aliyun.com/pypi/simple/
中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清華大學 https://pypi.tuna.tsinghua.edu.cn/simple/
中國科學技術大學 http://pypi.mirrors.ustc.edu.cn/simple/
一、Conda降級pytorch版本或安裝指定版本pytorch
conda install pytorch=0.4.1 -c soumith
conda install pytorch=0.4.1 torchvision
二、PIP降級或安裝指定版本pytorch
只提供離線安裝升級降級
pip install http://download.pytorch.org/whl/torch-0.4.1.post1-cp27-none-macosx_10_7_x86_64.whl
# 比如安裝0.2.0版本
# pip install http://download.pytorch.org/whl/torch-0.2.0.post1-cp35-cp35m-macosx_10_7_x86_64.whl
pip install torchvision
三、源碼安裝指定版本
如果喜歡用源碼編譯安裝,可以直接在github
尋找指定版本,安裝即可。
如何安裝指定版本Pytorch:
#使用conda安裝指定版本
conda install pytorch=0.1.10 -c soumith
#使用pip安裝指定版本
pip install pytorch==0.1.10
然後輸入即可同時安裝上pytorch和torchvision。
conda install pytorch=0.4.1 torchvision
如何查看當前pytorch版本:
import torch
print(torch.__version__)
把終端中所有信息都寫到文本文件中的方法如下:
在執行想要保存的命令之前, 在終端的命令行中輸入以下命令:
$ script -f output.txt
這樣在終端的當前文件夾下就會生成output.txt文件
接下來,在按Ctrl+D(該命令是停止的意思)之前,在命令窗口執行的所有命令包括終端輸出的所有信息都會寫到output.txt文件中。
GCC/G++
1、首先需要添加ppa到本地庫:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
2、更新本地庫:
sudo apt-get update
3、安裝自己想要的版本:
sudo apt-get install gcc-6 g++-6
4、 gcc版本切換 手動更換軟連接
sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc -f
sudo ln -s /usr/bin/gcc-ar-6 /usr/bin/gcc-ar -f
sudo ln -s /usr/bin/gcc-nm /usr/bin/gcc-nm -f
sudo ln -s /usr/bin/g++-nm /usr/bin/g++-nm -f
sudo ln -s /usr/bin/g++-ar-6 /usr/bin/g++-ar -f
sudo ln -s /usr/bin/g++-6 /usr/bin/g++ -f
5、 查看gcc版本命令: gcc -v
Auto-Gluon安裝:
# Here we assume CUDA 10.0 is installed. You should change the number
# according to your own CUDA version (e.g. mxnet-cu101 for CUDA 10.1).
pip install --upgrade mxnet-cu100
pip install autogluon
Ubuntu下查看opencv版本:
查看linux下的opencv安裝庫:
pkg-config opencv --libs
查看linux下的opencv安裝版本:
pkg-config opencv --modversion
查看linux下的opencv安裝路徑:
sudo find / -iname "*opencv*"