![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
文章平均质量分 84
Hhhy云帆
Keep simple things simple.
展开
-
Pytorch torch.optim.lr_scheduler API如何调整学习率
pytorch 学习率相关API原创 2022-07-29 11:00:36 · 791 阅读 · 1 评论 -
Pytorch使用技巧
import 包模块import argparseimport osimport torchfrom torch import nn, optimfrom torch.nn import functional as Ffrom torch.utils.data import DataLoaderfrom torchvision import datasets, transform...原创 2019-05-31 13:29:05 · 529 阅读 · 0 评论 -
Pytorch自定义损失函数losses.py
PyTorch已经有很多标准的损失函数,有时也需要创建自己的损失函数。为此,需要创建一个单独的文件 losses.py ,然后扩展 nn.Module类创建自定义损失函数:class CustomLoss(torch.nn.Module): def __init__(self): super(CustomLoss,self).__init__() ...原创 2019-05-31 15:20:45 · 5142 阅读 · 0 评论 -
coco数据集下载脚本
#!/usr/bin/env bashmkdir datawget http://msvocds.blob.core.windows.net/annotations-1-0-3/captions_train-val2014.zip -P ./data/wget http://images.cocodataset.org/zips/train2014.zip -P ./data/wget h...原创 2018-08-13 10:22:34 · 1139 阅读 · 0 评论 -
pytorch实现Linear regression
#!/usr/bin/env pythonfrom __future__ import print_functionfrom itertools import countimport torchimport torch.autogradimport torch.nn.functional as FPOLY_DEGREE = 4W_target = torch.randn(POLY...原创 2018-05-30 22:24:43 · 679 阅读 · 0 评论 -
pytorch实现mnist分类
torchvision包 包含了目前流行的数据集,模型结构和常用的图片转换工具。torchvision.datasets中包含了以下数据集 MNIST COCO(用于图像标注和目标检测)(Captioning and Detection) LSUN Classification ImageFolder Imagenet-12 CIFAR10 and CIFAR100 STL10...原创 2018-05-30 21:57:01 · 3063 阅读 · 0 评论 -
Ubuntu16.04 报错ImportError: torch.utils.ffi requires the cffi package
Traceback (most recent call last): File “/home/warp-ctc/pytorch_binding/setup.py”, line 7, in from torch.utils.ffi import create_extension File “/usr/local/lib/python2.7/dist-packages/torc...原创 2018-04-18 11:56:42 · 6334 阅读 · 9 评论 -
ubuntu16.04 安装pip install torch 出错
hy@hy-desktop:/devdata/$ pip install torch Collecting torch Using cached torch-0.1.2.post1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last)...原创 2018-03-07 19:31:54 · 2397 阅读 · 2 评论