conda环境备份

1.版本

python3.7

conda create -n sc_37 python=3.7

pytorch1.4.0   torchvision0.5.0

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

tensorboardx2.2

conda install -c conda-forge tensorboardx

使用

tensorboard --logdir=runs --bind_all

ok。

2.依赖的包

conda install -c conda-forge tqdm
conda install -c conda-forge pandas
conda install -c conda-forge scipy
pip install umap-learn
conda install -c conda-forge matplotlib
conda install -c conda-forge scikit-learn
pip install -U ray
pip install scanpy

https://www.cnblogs.com/BlueBlueSea/p/14781296.html,想使用tensorboard,仅仅

conda install -c conda-forge tensorboardx

是不够的,这样的话,在

from torch.utils.tensorboard import SummaryWriter

会报错,还需要安装tensorflow的。

tensorboardx在依旧需要tensorboard的支持,而安装tensorboard需要安装tensorflow。所以会涉及到版本依赖的问题。

目前版本情况是:

torch    1.8.0
tensorboardx    2.4
cuda    11.1
cudnn    8005

其中cudnn版本查看方法:

import torch
torch.backends.cudnn.version()

8005

 

 https://www.tensorflow.org/install/gpu

查看对应版本,但是目前使用的11.1版本的CUDA并没有对应的tf版本,所以最终还是选择11.0CUDA对应的tensorflow-2.4.0版本吧。

https://www.tensorflow.org/install/pip,用pip安装tf-gpu==2.4.0版本,首先尝试的是用conda命令:

conda install -c conda-forge tensorflow-gpu==2.4.0

但是报错:

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow-gpu==2.4.0

没找到这个版本,所以使用命令:

pip install tensorflow-gpu==2.4.0

一切ok,直接下载,那么再次尝试导入SummaryWriter,就ok了。

3.安装jupyter

转自:https://blog.csdn.net/xiaozhun1223/article/details/99689841

conda install jupyter notebook
jupyter notebook --generate-config

[root@xxj]# ipython
In [1]:  from notebook.auth import passwd
In [2]: passwd()

    vim /root/.jupyter/jupyter_notebook_config.py
    #改几个地方:
c.NotebookApp.ip = 'xx.xxx.xx.xxx'            即对外提供访问的ip,云服务外网ip
c.NotebookApp.port = 8888                     即对外提供访问的端口
c.NotebookApp.open_browser = False            False即启动不打开浏览器
c.NotebookApp.password = u'sha1:XXXXX'   这个就是上面生成的秘钥
c.NotebookApp.notebook_dir = u'/opt/jupyter_dir' 即设置jupyter启动后默认的根目录

 关于密码:直接生成的开头是:"password": "argon2:$argon2id....,不必要再加sha1,应该是argon2类型的密码。

posted @ 2021-05-19 11:35  lypbendlf  阅读(437)  评论(0编辑  收藏  举报