conda换源/pytorch安装

conda换源

https://zhuanlan.zhihu.com/p/95100538

anaconda清华源
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

conda本地安装下载的包
https://blog.csdn.net/zhaotun123/article/details/100765510

pytorch安装

import torch
print(torch.__version__)
print(torchvision.__version__)
print(torch.cuda.is_available())
torch.cuda.device_count()
torch.cuda.current_device()
torch.cuda.get_device_name(id)
print("cuDNN version is :")
print(torch.backends.cudnn.version())

如果是 True,意味着你可以使用 GPU,如果是 False,意味着只能使用CPU。

pytorch模型存储的两种方式
1.保存整个网络结构信息和模型参数信息:

torch.save(model_object, './model.pth')

直接加载即可使用:

model = torch.load('./model.pth')

2.只保存网络的模型参数-推荐使用

torch.save(model_object.state_dict(), './params.pth')

加载则要先从本地网络模块导入网络,然后再加载参数:

from models import AgeModel
model = AgeModel()
model.load_state_dict(torch.load('./params.pth'))

pytorch2onnx
https://pytorch.org/tutorials/advanced/super_resolution_with_caffe2.html

安装pytorch后在导入pytorch时libmkl_intel_lp64.so找不到解决办法
https://www.cnblogs.com/denny402/p/10848506.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 引用中的报错信息是关于CUDA运行时错误,具体错误原因是未知的。引用中的报错信息是关于计算交叉熵时出现了异常,原因是不支持多目标。引用中的报错信息是关于在使用sudo运行python程序时,系统默认使用的是系统自带的Python版本,而不是安装环境中的Python版本导致的。至于最后一段引用的内容,可能是截断了。根据提供的信息,无法得知具体的问题是什么。如果需要进一步帮助,请提供更详细的信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [RuntimeError: cuda runtime error (30) : unknown error at /opt/conda/conda-bld/pytorch_1556653114079/](https://blog.csdn.net/qq_43444008/article/details/109119597)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [RuntimeError: multi-target not supported at /opt/conda/conda-bld/pytorch_1549635019666/work/aten/src](https://blog.csdn.net/weixin_42419002/article/details/100988897)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值