博客
关于我
pytorch可视化 resnet50特征图
阅读量:82 次
发布时间:2019-02-26

本文共 1446 字,大约阅读时间需要 4 分钟。

ResNet50??????PyTorch???????? inference ??

????????ResNet50?????????????????????????????????????????????????????????????PyTorch??????ResNet50???????????????

??????

ResNet50??????????????????????Residual Blocks??????????????????

  • ????[1, 3, 224, 224]????????????????
  • ???1?[1, 64, 112, 112]
  • ?????1?[1, 64, 112, 112]
  • ?????ReLU?
  • ??????[1, 64, 56, 56]
  • ?1?[1, 256, 56, 56]
  • ?2?[1, 512, 28, 28]
  • ?3?[1, 1024, 14, 14]
  • ?4?[1, 2048, 7, 7]
  • ??????[1, 2048]
  • ?????[1, 1000]

???????

??? inference ??????????????????PyTorch?????????????????????????????????????

  • ??????PyTorch??????????ResNet50???
  • ????????????????????????
  • ???????????????????????????????
  • ??????

    ??????????????????

    import cv2import timeimport osimport matplotlib.pyplot as pltimport torchfrom torch import nnimport torchvision.models as modelsimport torchvision.transforms as transformssavepath = 'vis_resnet50/features_elephant'if not os.path.exists(savepath):    os.mkdir(savepath)def draw_features(width, height, x, savename):    tic = time.time()    fig = plt.figure(figsize=(16, 16))    fig.subplots_adjust(left=0.05, right=0.95, bottom=0.05, top=0.95, wspace=0.05)    # ??????????    plt.imshow(x)    plt.savefig(os.path.join(savepath, savename))    plt.close()    toc = time.time()    print(f"?????{toc - tic:.2f}?")

    ????

    • ?????ResNet50?????????????????[1, 3, 224, 224]?
    • ??????????PyTorch???????????????
    • ????????????????????????????????????????

    ????????????????ResNet50??????????????????????????

    转载地址:http://taxz.baihongyu.com/

    你可能感兴趣的文章
    php错误日志文件
    查看>>
    PHP错误解决:Array and string offset access syntax with curly braces is deprecated
    查看>>
    php隐藏手机号中间4位方法总结
    查看>>
    php面向对象三大特征封装、多态、继承
    查看>>
    php面向对象全攻略
    查看>>
    php面向对象的基础题
    查看>>
    php面试题二--解决网站大流量高并发方案(从url到硬盘来解决高并发方案总结)...
    查看>>
    php页面增加自选项,php-在Woocommerce中添加新的自定义默认订购目录选项
    查看>>
    php页面静态化技术;学习笔记
    查看>>
    php项目心得以及总结
    查看>>
    R&Python Data Science 系列:数据处理(4)长宽格式数据转换
    查看>>
    PHP项目集成支付宝PC端扫码支付API(国内支付)
    查看>>
    php预定义常量&变量
    查看>>
    R 集成算法③ 随机森林
    查看>>
    php验证码背景色设置无效
    查看>>
    php验证邮箱是否有效
    查看>>
    PHP高性能分布式应用服务器框架-SwooleDistributed
    查看>>
    PHP高效、轻量级表格数据处理库 OpenSpout
    查看>>
    R 数据缺失的处理
    查看>>
    php,nginx重启
    查看>>