zoukankan      html  css  js  c++  java
  • Python/pytorch 切换国内源/AttributeError: module 'torch.jit' has no attribute 'unused'/not a trusted or secure host

    Python/pytorch 切换国内源

    python-pytorch在下载包的时候,会因为服务器在国外,导致下载速度太慢。这时候就需要切换为国内的源。

    • 使用

    假设要安装vedo库,则在原来安装语句上添加-i和镜像地址即可。

    pip install vedo -i https://pypi.tuna.tsinghua.edu.cn/simple/
    
    • 其他源
    阿里云 http://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/
    

    导入torchvision出现:AttributeError: module ‘torch.jit‘ has no attribute ‘unused‘

    导入torchvision出现:AttributeError: module 'torch.jit' has no attribute 'unused'错误

    文章目录:
    1 问题原因
    2 解决方法
    我的本机环境:

    windows10系统
    torch1.2.0+cu92
    torchvision
    0.6.1+cu92
    1 问题原因
    我本机已经安装了torch==1.2.0+cu92版本,后面开始安装torchvision==0.6.1+cu92,成功安装并且没有出任何错误,但是在导入import torchvision的时候报错:AttributeError: module 'torch.jit' has no attribute 'unused'

    网上参考很多,都是说由于torch和torchvision的 版本导致的该错误。

    2 解决方法
    安装torch版本为1.4.0

    pip install torch==1.4.0 -f https://download.pytorch.org/whl/torch_stable.html
    

    安装torchvision版本为0.5.0

    pip install torchvision==0.5.0 -f https://download.pytorch.org/whl/torch_stable.html
    

    pycharm安装包 pip源提示“not a trusted or secure host” 解决

    问题:
    The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host mirrors.aliyun.com'. Could not find a version that satisfies the requirement proxy (from versions: ) No matching distribution found for proxy
    答案:
    http://mirrors.aliyun.com/pypi/simple/
    改成
    https://mirrors.aliyun.com/pypi/simple/

  • 相关阅读:
    yum 安装包的用法
    php session文件修改路径
    apache性能测试工具ab使用详解
    shell exit 0 exit 1
    网站架构(页面静态化,图片服务器分离,负载均衡)方案全解析
    【转载】新手如何快速打造高流量网站
    高并发处理方案
    HTML静态化技术
    在项目中学习.NET的json(二)之运费计算器
    在项目中学习.NET的json(一)
  • 原文地址:https://www.cnblogs.com/alanchens/p/14875722.html
Copyright © 2011-2022 走看看