Skip to content

Instantly share code, notes, and snippets.

@serithemage
Created September 29, 2019 00:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save serithemage/54bf347b41980b98ade2353b2e27d899 to your computer and use it in GitHub Desktop.
Save serithemage/54bf347b41980b98ade2353b2e27d899 to your computer and use it in GitHub Desktop.
Apache MXNet/gluon on Colab.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Apache MXNet/gluon on Colab.ipynb",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/serithemage/54bf347b41980b98ade2353b2e27d899/apache-mxnet-gluon-on-colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "NcFWElylPeA2",
"colab_type": "text"
},
"source": [
"# Apache MXNet/gluon on Colab\n",
"\n",
"- 이 문서는 Google Colab에서 Apache MXNet/gluon을 실행하기 위한 설정을 다루고 있습니다.\n",
"- 런타입 유형은 Python3에 하드웨어 가속은 GPU를 선택합니다.\n"
]
},
{
"cell_type": "code",
"metadata": {
"id": "R8SAdVwRPLSD",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 306
},
"outputId": "8ce06c58-9963-4468-f3e2-fee9b13c9976"
},
"source": [
"# CUDA버전을 확인합니다. 2019년 9월29일 현재 CUDA버전은 10.1입니다.\n",
"!nvidia-smi"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"text": [
"Sat Sep 28 23:38:24 2019 \n",
"+-----------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 430.40 Driver Version: 418.67 CUDA Version: 10.1 |\n",
"|-------------------------------+----------------------+----------------------+\n",
"| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
"| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n",
"|===============================+======================+======================|\n",
"| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
"| N/A 47C P8 10W / 70W | 0MiB / 15079MiB | 0% Default |\n",
"+-------------------------------+----------------------+----------------------+\n",
" \n",
"+-----------------------------------------------------------------------------+\n",
"| Processes: GPU Memory |\n",
"| GPU PID Type Process name Usage |\n",
"|=============================================================================|\n",
"| No running processes found |\n",
"+-----------------------------------------------------------------------------+\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "APnIKwwSbwNt",
"colab_type": "code",
"outputId": "ea411070-7fdc-4d3c-c38d-28690d6309e7",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 241
}
},
"source": [
"# CUDA버전에 맞춰 MXNet을 설치합니다. cudart를 포함한 일부 라이브러리가 10.1이 아닌 10.0으로 되어 있으므로 cu100으로 설치하였습니다.\n",
"!pip install mxnet-cu100"
],
"execution_count": 12,
"outputs": [
{
"output_type": "stream",
"text": [
"Collecting mxnet-cu100\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/56/d3/e939814957c2f09ecdd22daa166898889d54e5981e356832425d514edfb6/mxnet_cu100-1.5.0-py2.py3-none-manylinux1_x86_64.whl (540.1MB)\n",
"\u001b[K |████████████████████████████████| 540.1MB 44kB/s \n",
"\u001b[?25hRequirement already satisfied: graphviz<0.9.0,>=0.8.1 in /usr/local/lib/python3.6/dist-packages (from mxnet-cu100) (0.8.4)\n",
"Requirement already satisfied: numpy<2.0.0,>1.16.0 in /usr/local/lib/python3.6/dist-packages (from mxnet-cu100) (1.16.5)\n",
"Requirement already satisfied: requests<3,>=2.20.0 in /usr/local/lib/python3.6/dist-packages (from mxnet-cu100) (2.21.0)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.20.0->mxnet-cu100) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.20.0->mxnet-cu100) (2019.6.16)\n",
"Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.20.0->mxnet-cu100) (2.8)\n",
"Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.20.0->mxnet-cu100) (1.24.3)\n",
"Installing collected packages: mxnet-cu100\n",
"Successfully installed mxnet-cu100-1.5.0\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "FUkiCBfRb8mx",
"colab_type": "code",
"colab": {}
},
"source": [
"# 정상적으로 MXNet이 설치되었는지 테스트 합니다. 에러가 나지 않으면 정상 설치가 된 것 입니다.\n",
"import mxnet as mx\n",
"from mxnet import nd, autograd, gluon"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "UxJlmkq0RAwE",
"colab_type": "code",
"colab": {}
},
"source": [
""
],
"execution_count": 0,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment