CUDA11快速安装pytorch1.8

用conda创建新的虚拟环境

conda create -n 新环境名 python=版本号(新环境名自己随便取)

conda create -n pytorch1.8 python=3.7

切换至(激活)新的虚拟环境

conda activate 环境名

source activate pytorch1.8

到pytorch官网根据自己的情况进行选择:https://pytorch.org/
查看cuda=11.3,于是:

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

安装cv2

pip install opencv-python 

libGL.so.1: cannot open shared object file 的错误

新容器缺少依赖,安装一下就行了

apt update
apt install libgl1-mesa-glx
报`No module named 'tqdm'`错误
直接

```python
pip install tqdm

No module named 'imageio'错误

pip install imageio

No module named 'skimage'错误
意思是没有这个模块,在Linux服务器上需要先联网,联网之后使用命令

pip install scikit-image

等待下载安装完成即可

运行报No module named 'skimage.measure.simple_metrics'错误

/root/anaconda3/envs/pytorch1.8/lib/python3.7/site-packages/skimage/measure/

说明这个给路径里缺少simple_metrics.py这个文件,直接复制一个过去即可,也可以复制下边的代码写一个新的。

from warnings import warn
from ..metrics.simple_metrics import (mean_squared_error,
                                       peak_signal_noise_ratio,
                                       normalized_root_mse)

__all__ = ['compare_mse',
           'compare_nrmse',
           'compare_psnr',
           ]


def compare_mse(im1, im2):
    warn('DEPRECATED: skimage.measure.compare_mse has been moved to '
         'skimage.metrics.mean_squared_error. It will be removed from '
         'skimage.measure in version 0.18.', stacklevel=2)
    return mean_squared_error(im1, im2)


if mean_squared_error.__doc__ is not None:
    compare_mse.__doc__ = mean_squared_error.__doc__ + """
    Warns
    -----
    Deprecated:
        .. versionadded:: 0.16

        This function is deprecated and will be removed in scikit-image 0.18.
        Please use the function named ``mean_squared_error`` from the
        ``metrics`` module instead.

    See also
    --------
    skimage.metrics.mean_squared_error
    """


def compare_nrmse(im_true, im_test, norm_type='euclidean'):
    warn('DEPRECATED: skimage.measure.compare_nrmse has been moved to '
         'skimage.metrics.normalized_root_mse. It will be removed from '
         'skimage.measure in version 0.18.', stacklevel=2)
    return normalized_root_mse(im_true, im_test, normalization=norm_type)


if normalized_root_mse.__doc__ is not None:
    compare_nrmse.__doc__ = normalized_root_mse.__doc__ + """
    Warns
    -----
    Deprecated:
        .. versionadded:: 0.16

        This function is deprecated and will be removed in scikit-image 0.18.
        Please use the function named ``normalized_root_mse`` from the
        ``metrics`` module instead.

    See also
    --------
    skimage.metrics.normalized_root_mse
    """


def compare_psnr(im_true, im_test, data_range=None):
    warn('DEPRECATED: skimage.measure.compare_psnr has been moved to '
         'skimage.metrics.peak_signal_noise_ratio. It will be removed from '
         'skimage.measure in version 0.18.', stacklevel=2)
    return peak_signal_noise_ratio(im_true, im_test, data_range=data_range)


if peak_signal_noise_ratio.__doc__ is not None:
    compare_psnr.__doc__ = peak_signal_noise_ratio.__doc__ + """
    Warns
    -----
    Deprecated:
        .. versionadded:: 0.16

        This function is deprecated and will be removed in scikit-image 0.18.
        Please use the function named ``peak_signal_noise_ratio`` from the
        ``metrics`` module instead.

    See also
    --------
    skimage.metrics.peak_signal_noise_ratio
    """

在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值