前言
第七届“地震学算法与程序培训班” 于2021年8月9日–11日举办,本篇基于2021.8.10上午朱尉强博士的讲座搭建实验环境,程序及说明文档下载链接已提供,笔者使用的是Ubuntu18.04(虚拟机)系统,以此记录环境配置过程进行学习,特意在此感谢老师的开源资料!十分用心!
一、安装Python环境
1、安装miniconda
从miniconda官网下载miniconda,我下载的是Miniconda3-py37_4.10.3-Linux-x86_64版本。
aa@ubuntu:~/Downloads$ bash Miniconda3-py37_4.10.3-Linux-x86_64.sh -b -u
PREFIX=/home/aa/miniconda3
...
aa@ubuntu:~/Downloads$ gedit ~/.bashrc
export PATH=$HOME/miniconda3/bin:$PATH
aa@ubuntu:~/Downloads$ which python
/home/aa/miniconda3/bin/python
2、安装jupyter lab
1)安装jupyter lab: conda install jupyterlab --y 2)启动jupyter lab: jupyter lab
二、降噪 – DeepDenoiser
安装环境和测试 1)下载代码: git clone https://github.com/wayneweiqiang/DeepDenoiser.git 2)进入目录: cd DeepDenoiser 3)安装默认环境: conda env update -f=env.yml -n base 4)安装名为“deepdenoiser”的虚拟环境: conda env create -f env.yml conda activate deepdenoiser (如报错先激活环境👇) 创建好deepdenoiser环境之后进入deepdenoiser环境: aa@ubuntu:~/DeepDenoiser$ source activate (base)aa@ubuntu:~/DeepDenoiser$ conda activate deepdenoiser (deepdenoiser) aa@ubuntu:~/DeepDenoiser$ conda deactivate
5)下载例子(位于docs文件夹内,或者利用wget下载):
wget https://raw.githubusercontent.com/wayneweiqiang/DeepDenoiser/master/docs/example_interactive.ipynb
wget https://raw.githubusercontent.com/wayneweiqiang/DeepDenoiser/master/docs/example_batch_prediction.ipynb
(注意区分在命令行中跑的代码和在jupyter notebook中跑的代码)
三、到时拾取 – PhaseNet
安装环境和测试 1)下载代码:git clone https://github.com/wayneweiqiang/PhaseNet.git 2)进入目录:cd PhaseNet 3)安装默认环境:conda env update -f=env.yml -n base 4)安装名为“phasenet”的虚拟环境: conda env create -f env.yml conda activate phasenet (如报错先激活环境👇) 创建好phasenet环境之后进入phasenet环境: aa@ubuntu:~/PhaseNet$ source activate (base)aa@ubuntu:~/PhaseNet$ conda activate phasenet (phasenet) aa@ubuntu:~/PhaseNet$ conda deactivate 5)下载例子(位于docs文件夹内,或者利用wget下载):
wget https:
wget https:
四、初步检测流程 – QuakeFlo
安装环境和测试 1)下载代码:git clone https://github.com/wayneweiqiang/QuakeFlow.git 2)进入目录:cd QuakeFlow 3)安装默认环境:conda env update -f=env.yml -n base 4)安装名为“quakeflow”的虚拟环境: conda env create -f env.yml conda activate quakeflow (如报错先激活环境👇) 创建好quakeflow环境之后进入quakeflow环境: aa@ubuntu:~/QuakeFlow$ source activate (base)aa@ubuntu:~/QuakeFlow$ conda activate quakeflow (quakeflow) aa@ubuntu:~/QuakeFlow$ conda deactivate 5)下载例子(位于docs文件夹内,或者利用wget下载):
wget https:
wget https:
五、其他
1)Vm虚拟机内存不够扩展Ubuntu系统磁盘空间——解决 2)输conda activate deepdenoiser报错:CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’——解决
aa@ubuntu:~/DeepDenoiser$ source activate
(base) aa@ubuntu:~/DeepDenoiser$ conda activate deepdenoiser
(deepdenoiser) aa@ubuntu:~/DeepDenoiser$ conda deactivate
(base) aa@ubuntu:~/DeepDenoiser$ conda deactivate
aa@ubuntu:~/DeepDenoiser$
3)查看环境
aa@ubuntu:~$ conda info --envs
base * /home/aa/miniconda3
deepdenoiser /home/aa/miniconda3/envs/deepdenoiser
phasenet /home/aa/miniconda3/envs/phasenet
quakeflow /home/aa/miniconda3/envs/quakeflow
|