【常用到的一些命令记录】

ffmpeg的安装
pip3 install ffmpeg-python
faiss的安装
pip install faiss-gpu
sklearn的安装
pip install scikit-learn
hydra的安装
pip install hydra-core --upgrade
https://github.com/speechbrain/speechbrain/issues/2287#issuecomment-1837240393
sudo apt-get update
apt-get install libsox-dev
常用到的一些命令记录(本人记性非常不好)
CPU线程数
nproc --all
查看内存占用情况
du -h --max-depth=1 ./
查看所有文件夹大小
du -sh *
清理conda缓存
conda clean -y --all
在终端执行命令时使用GPU
CUDA_VISIBLE_DEVICES=1 Only device 1 will be seen
CUDA_VISIBLE_DEVICES=0,1 Devices 0 and 1 will be visible
CUDA_VISIBLE_DEVICES="" No GPU will be visible
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0, 1"
CUDA 12.4
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
CUDA 11.8
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
CUDA 11.4
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
查看信息
nvidia-smi
watch -n 0.1 -d nvidia-smi #每隔0.1秒刷新一次
终止你拥有的全部进程
kill -9 -1
暂停进程
kill -STOP <进程号>
继续进程
kill -CONT <进程号>
拷贝文件夹
cp --path source target
删除文件
rmdir 空文件夹
删除指定后缀名的文件
find -name '8017058d*' -exec rm '{}' \;
打包并删除源文件
tar -cvzf xxxx.tar.gz xxxx --remove-files
新建虚拟环境
conda create -n yourname python==3.7 numpy
退出虚拟环境
conda deactivate
列表
conda env list
windows上的
安装
pip install ipykernel
pip install ipython_genutils
与Jupyterbook建立连接
python -m ipykernel install --user --name yourname
Check
jupyter kernelspec list
在Jupyterbook删除
jupyter kernelspec remove yourname
Linux上
conda install -c conda-forge jupyter notebook
删除虚拟环境
conda remove -n yourname --all
使用setup.py安装第三方库
1、下载你要安装的包,并解压。
2、进入到解压后的文件 setup.py 目录下 ,右键选择在此处打开cmd。
3、输入命令:python setup.py build
4、输入命令:python setup.py install
可能有用的pip源 pip install -i http://xxx
(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/
(6)网易 http://mirrors.163.com/pypi/simple/
登录服务器
ssh -p 10019 username@114.212.224.242
传输文件
scp -P 10019 -r xxx/MusicCaps/ username@114.212.224.242:/data/hdd1/music_database/
挂载
mkdir -p ~/sshfs/103
sshfs tianws@103:/home/tianws ~/sshfs/103
验证远程文件系统挂载成功
ls ~/sshfs/103
df -hT
git
首先创建仓库
git clone http
编辑.gitignore
**____pycache__
git add .
git commit -m "first try"
git push
回滚到之前某一版本且该版本后的提交都不需要
git log 查看版本号
git reset --hard 版本号
git push -f 回滚远程仓库版本

Win10的Ubuntu子系统
挂载磁盘
sudo mkdir /mnt/d
sudo mount -t drvfs D: /mnt/d
卸载
sudo umount /mnt/d

退出python
exit()
tmux左右分屏
ctrl+b %
上下分屏:
ctrl+b "
tmux开新的屏幕
ctrl+b :new
tmux new -s name
设定鼠标滚动支持
tmux set mouse on
移动光标
tmux select-pane -U/-D/-L/-R

指定CUDA
CUDA_VISIBLE_DEVICES=gpu_ids python train.py

保存密码
vim ./ssh/config
Host
h5py库读写超过内存的大数据
https://blog.csdn.net/weixin_33957648/article/details/93609262

我的电脑CUDA版本
11.4.56
安装合适的Pytorch
pip3 install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio==0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

sftp 上传文件报错
error while writing: received failure with description 'Failure'
服务器某一个空间满了,查看空间使用情况清理即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值