开发者社区> 一个处女座的程序猿> 正文

DL框架之MXNet :深度学习框架之MXNet 的简介、安装、使用方法、应用案例之详细攻略

简介: MXNet 是亚马逊(Amazon)选择的深度学习库,并且也许是最优秀的库之一。它拥有类似于 Theano 和 TensorFlow 的数据流图,为多 GPU 配置提供了良好的配置,有着类似于 Lasagne 和 Blocks 更高级别的模型构建块,并且可以在你可以想象的任何硬件上运行(包括手机)。对 Python 的支持只是其冰山一角—MXNet 同样提供了对 R、Julia、C++、Scala、Matlab,和 Javascript 的接口。
+关注继续查看

 DL框架之MXNet :深度学习框架之MXNet 的简介、安装、使用方法、应用案例之详细攻略

目录

MXNet 的简介

1、优缺点

2、相关文章

3、相关链接

MXNet 的安装

MXNet 的使用方法

1、个人使用总结

2、经典模型集合—MXNet Model Zoo

3、模型分类

MXNet 的应用案例


MXNet 的简介

image.gif

        A flexible and efficient library for deep learning.

  MXNet 是亚马逊(Amazon)选择的深度学习库,并且也许是最优秀的库之一。它拥有类似于 Theano 和 TensorFlow 的数据流图,为多 GPU 配置提供了良好的配置,有着类似于 Lasagne 和 Blocks 更高级别的模型构建块,并且可以在你可以想象的任何硬件上运行(包括手机)。对 Python 的支持只是其冰山一角—MXNet 同样提供了对 R、Julia、C++、Scala、Matlab,和 Javascript 的接口。

        MXNet 是一个旨在提高效率和灵活性的深度学习框架。像MXNet这样的加速库提供了强大的工具来帮助开发人员利用GPU和云计算的全部功能。虽然这些工具通常适用于任何数学计算,但MXNet特别强调加速大规模深度神经网络的开发和部署。特别是,我们提供以下功能:

    • 设备放置:使用MXNet,可以轻松指定每个数据结构的生存位置。
    • 多GPU培训MXNet可以通过可用GPU的数量轻松扩展计算。
    • 自动区分MXNet自动执行曾经陷入神经网络研究的衍生计算。
    • 优化的预定义图层:虽然您可以在MXNet编写自己的图层,但预定义的图层会针对速度进行优化,优于竞争库。

            MXNet 官方自我评价:MXNet结合了高性能,干净的代码,高级API访问和低级控制,是深度学习框架中独一无二的选择。

    1、优缺点

    优点

      1. 速度的标杆
      2. 灵活的编程模型:非常灵活。支持命令式和符号式编程模型以最大化效率和性能。
      3. 从云端到客户端可移植:可运行于多CPU、多GPU、集群、服务器、工作站甚至移动智能手机。
      4. 多语言支持:支持七种主流编程语言,包括C++、Python、R、Scala、Julia、Matlab和JavaScript。事实上,它是唯一支持所有 R 函数的构架。
      5. 本地分布式训练:支持在多CPU/GPU设备上的分布式训练,使其可充分利用云计算的规模优势。
      6. 性能优化:使用一个优化的C++后端引擎并行I/O和计算,无论使用哪种语言都能达到最佳性能。
      7. 云端友好,可直接与S3,HDFS和Azure兼容

      缺点

        1. 最小的社区
        2. 比 Theano 学习更困难一点

        2、相关文章

        MXNet: A Flexible and Efficient Machine Learning Library for Heterogeneous Distributed Systems

        image.gif

                MXnet是一个多语言机器学习(ML)库,用于简化ML算法的开发,特别是对于深度神经网络。它嵌入在宿主语言中,将声明性符号表达式与命令式张量计算混合在一起。它提供自动微分来推导梯度。MXnet具有计算和内存效率高的特点,可以在各种异构系统上运行,从移动设备到分布式GPU集群。本文介绍了MXnet的API设计和系统实现,并解释了如何统一处理符号表达式和张量操作的嵌入。我们的初步实验表明,在使用多个GPU机器的大规模深度神经网络应用中,有着很好的结果。

        3、相关链接

        官网地址:Apache MXNet | A flexible and efficient library for deep learning.

        GitHub地址01:https://github.com/dmlc/mxnet

        GitHub地址02:https://github.com/apache/incubator-mxnet/tree/master/example

        MXNet - Python API:http://mxnet.incubator.apache.org/api/python/index.html#python-api-reference

        PyPi地址:mxnet · PyPI

         

        MXNet 的安装

        1、第一次安装

        pip install mxnet

        image.gif

        Collecting mxnet
          Downloading https://files.pythonhosted.org/packages/d1/b6/38d9ab1b16c456224823e737f1bb95fe3ff056f3834fba01cd157d59b574/mxnet-1.4.0.post0-py2.py3-none-win_amd64.whl (21.9MB)
            100% |████████████████████████████████| 21.9MB 34kB/s
        Requirement already satisfied: requests<2.19.0,>=2.18.4 in f:\program files\python\python36\lib\site-packages (from mxnet) (2.18.4)
        Collecting graphviz<0.9.0,>=0.8.1 (from mxnet)
          Downloading https://files.pythonhosted.org/packages/53/39/4ab213673844e0c004bed8a0781a0721a3f6bb23eb8854ee75c236428892/graphviz-0.8.4-py2.py3-none-any.whl
        Collecting numpy<1.15.0,>=1.8.2 (from mxnet)
          Downloading https://files.pythonhosted.org/packages/dc/99/f824a73251589d9fcef2384f9dd21bd1601597fda92ced5882940586ec37/numpy-1.14.6-cp36-none-win_amd64.whl (13.4MB)
            100% |████████████████████████████████| 13.4MB 30kB/s
        Requirement already satisfied: certifi>=2017.4.17 in f:\program files\python\python36\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (2018.1.18)
        Requirement already satisfied: chardet<3.1.0,>=3.0.2 in f:\program files\python\python36\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (3.0.4)
        Requirement already satisfied: urllib3<1.23,>=1.21.1 in f:\program files\python\python36\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (1.22)
        Requirement already satisfied: idna<2.7,>=2.5 in f:\program files\python\python36\lib\site-packages (from requests<2.19.0,>=2.18.4->mxnet) (2.6)
        tensorflow-gpu 1.4.0 requires enum34>=1.1.6, which is not installed.
        tensorflow 1.10.0 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.14.6 which is incompatible.
        moviepy 0.2.3.2 has requirement decorator==4.0.11, but you'll have decorator 4.3.0 which is incompatible.
        moviepy 0.2.3.2 has requirement tqdm==4.11.2, but you'll have tqdm 4.25.0 which is incompatible.
        Installing collected packages: graphviz, numpy, mxnet
          Found existing installation: numpy 1.15.0rc1+mkl
            Uninstalling numpy-1.15.0rc1+mkl:
        Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'f:\\program files\\python\\python36\\lib\\site-packages\\numpy\\core\\_multiarray_tests.cp36-win_amd64.pyd'
        Consider using the `--user` option or check the permissions.

        image.gif

        遇到问题:成功解决Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'f:\\program files\\p

        2、第二次安装

        image.gif

        tensorflow-gpu 1.4.0 requires enum34>=1.1.6, which is not installed.
        tensorflow 1.10.0 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.14.6 which is incompatible.
        moviepy 0.2.3.2 has requirement decorator==4.0.11, but you'll have decorator 4.3.0 which is incompatible.
        moviepy 0.2.3.2 has requirement tqdm==4.11.2, but you'll have tqdm 4.25.0 which is incompatible.

        image.gif

        MXNet 的使用方法

        后期更新……

        1、个人使用总结

        DL框架之MXNet :深度学习框架之MXNet 常见使用方法(个人使用)总结之详细攻略

        相关链接:Apache MXNet | A flexible and efficient library for deep learning.

        2、经典模型集合—MXNet Model Zoo

        AliasNetwork# ParametersTop-1 AccuracyTop-5 AccuracyOrigin
        alexnetAlexNet61,100,8400.54920.7803Converted from pytorch vision
        densenet121DenseNet-1218,062,5040.74970.9225Converted from pytorch vision
        densenet161DenseNet-16128,900,9360.77700.9380Converted from pytorch vision
        densenet169DenseNet-16914,307,8800.76170.9317Converted from pytorch vision
        densenet201DenseNet-20120,242,9840.77320.9362Converted from pytorch vision
        inceptionv3Inception V3 299x29923,869,0000.77550.9364Converted from pytorch vision
        mobilenet0.25MobileNet 0.25475,5440.51850.7608Trained with script
        mobilenet0.5MobileNet 0.51,342,5360.63070.8475Trained with script
        mobilenet0.75MobileNet 0.752,601,9760.67380.8782Trained with script
        mobilenet1.0MobileNet 1.04,253,8640.71050.9006Trained with script
        mobilenetv2_1.0MobileNetV2 1.03,539,1360.71920.9056Trained with script
        mobilenetv2_0.75MobileNetV2 0.752,653,8640.69610.8895Trained with script
        mobilenetv2_0.5MobileNetV2 0.51,983,1040.64490.8547Trained with script
        mobilenetv2_0.25MobileNetV2 0.251,526,8560.50740.7456Trained with script
        resnet18_v1ResNet-18 V111,699,1120.70930.8992Trained with script
        resnet34_v1ResNet-34 V121,814,6960.74370.9187Trained with script
        resnet50_v1ResNet-50 V125,629,0320.76470.9313Trained with script
        resnet101_v1ResNet-101 V144,695,1440.78340.9401Trained with script
        resnet152_v1ResNet-152 V160,404,0720.79000.9438Trained with script
        resnet18_v2ResNet-18 V211,695,7960.71000.8992Trained with script
        resnet34_v2ResNet-34 V221,811,3800.74400.9208Trained with script
        resnet50_v2ResNet-50 V225,595,0600.77110.9343Trained with script
        resnet101_v2ResNet-101 V244,639,4120.78530.9417Trained with script
        resnet152_v2ResNet-152 V260,329,1400.79210.9431Trained with script
        squeezenet1.0SqueezeNet 1.01,248,4240.56110.7909Converted from pytorch vision
        squeezenet1.1SqueezeNet 1.11,235,4960.54960.7817Converted from pytorch vision
        vgg11VGG-11132,863,3360.66620.8734Converted from pytorch vision
        vgg13VGG-13133,047,8480.67740.8811Converted from pytorch vision
        vgg16VGG-16138,357,5440.73230.9132Trained with script
        vgg19VGG-19143,667,2400.74110.9135Trained with script
        vgg11_bnVGG-11 with batch normalization132,874,3440.68590.8872Converted from pytorch vision
        vgg13_bnVGG-13 with batch normalization133,059,6240.68840.8882Converted from pytorch vision
        vgg16_bnVGG-16 with batch normalization138,374,4400.73100.9176Trained with script
        vgg19_bnVGG-19 with batch normalization143,689,2560.74330.9185Trained with script
        get_modelReturns a pre-defined model by name

        3、模型分类

        ResNet

        resnet18_v1ResNet-18 V1 model from “Deep Residual Learning for Image Recognition” paper.
        resnet34_v1ResNet-34 V1 model from “Deep Residual Learning for Image Recognition” paper.
        resnet50_v1ResNet-50 V1 model from “Deep Residual Learning for Image Recognition” paper.
        resnet101_v1ResNet-101 V1 model from “Deep Residual Learning for Image Recognition” paper.
        resnet152_v1ResNet-152 V1 model from “Deep Residual Learning for Image Recognition” paper.
        resnet18_v2ResNet-18 V2 model from “Identity Mappings in Deep Residual Networks” paper.
        resnet34_v2ResNet-34 V2 model from “Identity Mappings in Deep Residual Networks” paper.
        resnet50_v2ResNet-50 V2 model from “Identity Mappings in Deep Residual Networks” paper.
        resnet101_v2ResNet-101 V2 model from “Identity Mappings in Deep Residual Networks” paper.
        resnet152_v2ResNet-152 V2 model from “Identity Mappings in Deep Residual Networks” paper.
        ResNetV1ResNet V1 model from “Deep Residual Learning for Image Recognition” paper.
        ResNetV2ResNet V2 model from “Identity Mappings in Deep Residual Networks” paper.
        BasicBlockV1BasicBlock V1 from “Deep Residual Learning for Image Recognition” paper.
        BasicBlockV2BasicBlock V2 from “Identity Mappings in Deep Residual Networks” paper.
        BottleneckV1Bottleneck V1 from “Deep Residual Learning for Image Recognition” paper.
        BottleneckV2Bottleneck V2 from “Identity Mappings in Deep Residual Networks” paper.
        get_resnetResNet V1 model from “Deep Residual Learning for Image Recognition” paper.

        VGG

        vgg11VGG-11 model from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg13VGG-13 model from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg16VGG-16 model from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg19VGG-19 model from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg11_bnVGG-11 model with batch normalization from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg13_bnVGG-13 model with batch normalization from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg16_bnVGG-16 model with batch normalization from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.
        vgg19_bnVGG-19 model with batch normalization from the “Very Deep Convolutional Networks for Large-Scale Image Recognition” paper.

        Alexnet

        alexnetAlexNet model from the “One weird trick...” paper.
        AlexNetAlexNet model from the “One weird trick...” paper.

        DenseNet

        densenet121Densenet-BC 121-layer model from the “Densely Connected Convolutional Networks” paper.
        densenet161Densenet-BC 161-layer model from the “Densely Connected Convolutional Networks” paper.
        densenet169Densenet-BC 169-layer model from the “Densely Connected Convolutional Networks” paper.
        densenet201Densenet-BC 201-layer model from the “Densely Connected Convolutional Networks” paper.
        DenseNetDensenet-BC model from the “Densely Connected Convolutional Networks” paper.

        SqueezeNet

        squeezenet1_0SqueezeNet 1.0 model from the “SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size” paper.
        squeezenet1_1SqueezeNet 1.1 model from the official SqueezeNet repo.

        Inception

        inception_v3Inception v3 model from “Rethinking the Inception Architecture for Computer Vision” paper.

        MobileNet

        mobilenet1_0MobileNet model from the “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications” paper, with width multiplier 1.0.
        mobilenet0_75MobileNet model from the “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications” paper, with width multiplier 0.75.
        mobilenet0_5MobileNet model from the “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications” paper, with width multiplier 0.5.
        mobilenet0_25MobileNet model from the “MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications” paper, with width multiplier 0.25.
        mobilenet_v2_1_0MobileNetV2 model from the “Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation” paper.
        mobilenet_v2_0_75MobileNetV2 model from the “Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation” paper.
        mobilenet_v2_0_5MobileNetV2 model from the “Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation” paper.
        mobilenet_v2_0_25MobileNetV2 model from the “Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation” paper.

        MXNet 的应用案例

        后期继续更新……


        版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

        相关文章
        神工鬼斧惟肖惟妙,M1 mac系统深度学习框架Pytorch的二次元动漫动画风格迁移滤镜AnimeGANv2+Ffmpeg(图片+视频)快速实践
        前段时间,业界鼎鼎有名的动漫风格转化滤镜库AnimeGAN发布了最新的v2版本,一时间街谈巷议,风头无两。提起二次元,目前国内用户基数最大的无疑是抖音客户端,其内置的一款动画转换滤镜“变身漫画”,能够让用户在直播中,把自己的实际外貌转换为二次元“画风”。对于二次元粉丝来说,“打破次元壁,变身纸片人”这种自娱自乐方式可谓屡试不爽
        126 0
        【MindSpore深度学习框架】MindSpore中的张量Tensor
        【MindSpore深度学习框架】MindSpore中的张量Tensor
        27 0
        【MindSpore深度学习框架】MindSpore的数据类型
        【MindSpore深度学习框架】MindSpore的数据类型
        24 0
        【MindSpore深度学习框架】实现简单线性回归
        【MindSpore深度学习框架】实现简单线性回归
        32 0
        【深度学习框架TensorFlow】使用TensorFlow框架构建全连接的神经网络,实现手写数字识别
        【深度学习框架TensorFlow】使用TensorFlow框架构建全连接的神经网络,实现手写数字识别
        61 0
        深度学习入门(4)【深度学习实战】无框架实现两层神经网络的搭建与训练过程
        深度学习入门(4)【深度学习实战】无框架实现两层神经网络的搭建与训练过程
        67 0
        【从零开始学习深度学习】4.基于pytorch框架自带模型实现线性回归的训练过程
        【从零开始学习深度学习】4.基于pytorch框架自带模型实现线性回归的训练过程
        79 0
        【从零开始学习深度学习】2. 深度学习框架Pytorch如何自动求梯度(gradient)
        【从零开始学习深度学习】2. 深度学习框架Pytorch如何自动求梯度(gradient)
        59 0
        【从零开始学习深度学习】1. 深度学习框架Pytorch的基本操作
        【从零开始学习深度学习】1. 深度学习框架Pytorch的基本操作
        60 0
        史上最全深度学习环境配置教程---适用于各种深度学习框架---Pytorh TensorFlow Keras-等和各种python环境(三)
        史上最全深度学习环境配置教程---适用于各种深度学习框架---Pytorh TensorFlow Keras-等和各种python环境(三)
        55 0
        +关注
        一个处女座的程序猿
        国内互联网圈知名博主、人工智能领域优秀创作者,全球最大中文IT社区博客专家、CSDN开发者联盟生态成员、中国开源社区专家、华为云社区专家、51CTO社区专家、Python社区专家等,曾受邀采访和评审十多次。仅在国内的CSDN平台,博客文章浏览量超过2500万,拥有超过57万的粉丝。
        文章
        问答
        文章排行榜
        最热
        最新
        相关电子书
        更多
        深度学习框架实战-Tensorflow
        立即下载
        TensorRT Introduction
        立即下载
        端上智能-深度学习模型压缩与加速
        立即下载