Skip to content

Instantly share code, notes, and snippets.

@alexschultz
Created February 7, 2018 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexschultz/5d27a5f054f1e59c08ca9b98b57d18cb to your computer and use it in GitHub Desktop.
Save alexschultz/5d27a5f054f1e59c08ca9b98b57d18cb to your computer and use it in GitHub Desktop.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SSD: Single Shot MultiBox Object Detector"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting mxnet-cu80==0.12.0\n",
" Downloading mxnet_cu80-0.12.0-py2.py3-none-manylinux1_x86_64.whl (219.5MB)\n",
"Requirement already satisfied: numpy in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from mxnet-cu80==0.12.0)\n",
"Requirement already satisfied: requests in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from mxnet-cu80==0.12.0)\n",
"Requirement already satisfied: graphviz in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from mxnet-cu80==0.12.0)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from requests->mxnet-cu80==0.12.0)\n",
"Requirement already satisfied: idna<2.7,>=2.5 in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from requests->mxnet-cu80==0.12.0)\n",
"Requirement already satisfied: urllib3<1.23,>=1.21.1 in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from requests->mxnet-cu80==0.12.0)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /home/ec2-user/anaconda3/envs/mxnet_p36/lib/python3.6/site-packages (from requests->mxnet-cu80==0.12.0)\n",
"Installing collected packages: mxnet-cu80\n",
"Successfully installed mxnet-cu80-0.12.0\n"
]
}
],
"source": [
"%%bash\n",
"\n",
"pip install mxnet-cu80==0.12.0"
]
},
{
"cell_type": "code",
"execution_count": 100,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 36 ms, sys: 8 ms, total: 44 ms\n",
"Wall time: 69.2 ms\n"
]
}
],
"source": [
"%%time\n",
"import boto3\n",
"import re\n",
"from sagemaker import get_execution_role\n",
"\n",
"role = get_execution_role()\n",
"\n",
"bucket='read-to-me-dataset'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Fine-tuning the Object Detection model\n",
"\n",
"The text-blocks dataset consist of images from 1 class and has ~500 images.\n",
"\n",
"For this notebook, we will be using the [recordio format](https://mxnet.incubator.apache.org/tutorials/basic/record_io.html)."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Cloning into 'incubator-mxnet'...\n"
]
}
],
"source": [
"%%bash\n",
"\n",
"echo checking for incubator-mxnet dir\n",
"DIR=incubator-mxnet\n",
"if [[ -d $DIR ]]; then\n",
" echo found existing git repo\n",
" echo deleting incubator-mxnet\n",
" rm -rf incubator-mxnet\n",
"fi\n",
"\n",
"git clone https://github.com/apache/incubator-mxnet.git"
]
},
{
"cell_type": "code",
"execution_count": 85,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"398\n",
"359\n",
"39\n"
]
}
],
"source": [
"import os\n",
"import urllib.request\n",
"import boto3\n",
"import zipfile\n",
"import shutil\n",
"from pathlib import Path\n",
"import random\n",
"\n",
"def download_from_s3(s3Key):\n",
" s3 = boto3.resource('s3')\n",
" try:\n",
" s3.Bucket(bucket).download_file(s3Key, s3Key)\n",
" except Exception as e:\n",
" raise\n",
"\n",
"def upload_to_s3(channel, file):\n",
" s3 = boto3.resource('s3')\n",
" data = open(file, \"rb\")\n",
" key = channel + '/' + file\n",
" s3.Bucket(bucket).put_object(Key=key, Body=data)\n",
"\n",
" \n",
"# # remove training dir if exists\n",
"if os.path.exists(\"incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018\"):\n",
" shutil.rmtree('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018')\n",
" \n",
"\n",
"# # text-block-custom dataset\n",
"download_from_s3('2018.zip')\n",
"os.makedirs('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/JPEGImages')\n",
"os.makedirs('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/Annotations')\n",
"destination_dir = 'incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/'\n",
"z = zipfile.ZipFile('2018.zip', 'r')\n",
"for file in z.namelist():\n",
" if file.endswith('.jpg'):\n",
" outfile_path = destination_dir + 'JPEGImages/' + file\n",
" else:\n",
" outfile_path = destination_dir + 'Annotations/' + file\n",
" \n",
" outfile = open(outfile_path, 'wb')\n",
" outfile.write(z.read(file))\n",
" outfile.close()\n",
"z.close()\n",
"\n",
"\n",
"files = []\n",
"for filename in os.listdir('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/JPEGImages/'):\n",
" if filename.endswith('.jpg'):\n",
" files.append('{0}'.format(Path(filename).stem))\n",
"\n",
"# # Take 10% of the data and use it for validation, the rest goes to training\n",
"training = []\n",
"validation = []\n",
"validationPercent = 10\n",
"k = int(len(files) * validationPercent // 100)\n",
"indices = random.sample(range(len(files)), k)\n",
"for index, file in enumerate(files):\n",
" if index not in indices:\n",
" training.append(file)\n",
" else:\n",
" validation.append(file)\n",
"\n",
"\n",
"print(len(files))\n",
"print(len(training))\n",
"print(len(validation))\n",
"\n",
"os.makedirs('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/ImageSets/Main/')\n",
"with open('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/ImageSets/Main/training.txt', 'w') as training_list:\n",
" for _, row in enumerate(training):\n",
" training_list.write('{}\\n'.format(row))\n",
" \n",
"with open('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/training.lst', 'w') as training_file:\n",
" for _, row in enumerate(training):\n",
" training_file.write('{0}\\t{1}\\tJPEGImages/{2}.jpg\\n'.format(row, 0.0,row ))\n",
"\n",
"\n",
"with open('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/ImageSets/Main/validation.txt', 'w') as validation_list:\n",
" for _, row in enumerate(validation):\n",
" validation_list.write('{}\\n'.format(row))\n",
"\n",
"with open('incubator-mxnet/example/ssd/data/VOCdevkit/VOC2018/validation.lst', 'w') as validation_file:\n",
" for _, row in enumerate(validation):\n",
" validation_file.write('{0}\\t{1}\\tJPEGImages/{2}.jpg\\n'.format(row, 0.0,row ))\n",
"\n",
"\n",
"\n",
"#upload_to_s3('validation', 'read-to-me-val.rec')\n",
"#upload_to_s3('train', 'read-to-me-train.rec')"
]
},
{
"cell_type": "code",
"execution_count": 101,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"saving list to disk...\n",
"/home/ec2-user/SageMaker/incubator-mxnet/example/ssd/tools/../data/VOCdevkit\n",
"./data/train.lst\n",
"[------------------------] 0.0% ...\r",
"[------------------------] 0.3% ...\r",
"[------------------------] 0.6% ...\r",
"[------------------------] 0.8% ...\r",
"[------------------------] 1.1% ...\r",
"[------------------------] 1.4% ...\r",
"[------------------------] 1.7% ...\r",
"[------------------------] 1.9% ...\r",
"[=-----------------------] 2.2% ...\r",
"[=-----------------------] 2.5% ...\r",
"[=-----------------------] 2.8% ...\r",
"[=-----------------------] 3.1% ...\r",
"[=-----------------------] 3.3% ...\r",
"[=-----------------------] 3.6% ...\r",
"[=-----------------------] 3.9% ...\r",
"[=-----------------------] 4.2% ...\r",
"[=-----------------------] 4.5% ...\r",
"[=-----------------------] 4.7% ...\r",
"[=-----------------------] 5.0% ...\r",
"[=-----------------------] 5.3% ...\r",
"[=-----------------------] 5.6% ...\r",
"[=-----------------------] 5.8% ...\r",
"[=-----------------------] 6.1% ...\r",
"[==----------------------] 6.4% ...\r",
"[==----------------------] 6.7% ...\r",
"[==----------------------] 7.0% ...\r",
"[==----------------------] 7.2% ...\r",
"[==----------------------] 7.5% ...\r",
"[==----------------------] 7.8% ...\r",
"[==----------------------] 8.1% ...\r",
"[==----------------------] 8.4% ...\r",
"[==----------------------] 8.6% ...\r",
"[==----------------------] 8.9% ...\r",
"[==----------------------] 9.2% ...\r",
"[==----------------------] 9.5% ...\r",
"[==----------------------] 9.7% ...\r",
"[==----------------------] 10.0% ...\r",
"[==----------------------] 10.3% ...\r",
"[===---------------------] 10.6% ...\r",
"[===---------------------] 10.9% ...\r",
"[===---------------------] 11.1% ...\r",
"[===---------------------] 11.4% ...\r",
"[===---------------------] 11.7% ...\r",
"[===---------------------] 12.0% ...\r",
"[===---------------------] 12.3% ...\r",
"[===---------------------] 12.5% ...\r",
"[===---------------------] 12.8% ...\r",
"[===---------------------] 13.1% ...\r",
"[===---------------------] 13.4% ...\r",
"[===---------------------] 13.6% ...\r",
"[===---------------------] 13.9% ...\r",
"[===---------------------] 14.2% ...\r",
"[===---------------------] 14.5% ...\r",
"[====--------------------] 14.8% ...\r",
"[====--------------------] 15.0% ...\r",
"[====--------------------] 15.3% ...\r",
"[====--------------------] 15.6% ...\r",
"[====--------------------] 15.9% ...\r",
"[====--------------------] 16.2% ...\r",
"[====--------------------] 16.4% ...\r",
"[====--------------------] 16.7% ...\r",
"[====--------------------] 17.0% ...\r",
"[====--------------------] 17.3% ...\r",
"[====--------------------] 17.5% ...\r",
"[====--------------------] 17.8% ...\r",
"[====--------------------] 18.1% ...\r",
"[====--------------------] 18.4% ...\r",
"[====--------------------] 18.7% ...\r",
"[=====-------------------] 18.9% ...\r",
"[=====-------------------] 19.2% ...\r",
"[=====-------------------] 19.5% ...\r",
"[=====-------------------] 19.8% ...\r",
"[=====-------------------] 20.1% ...\r",
"[=====-------------------] 20.3% ...\r",
"[=====-------------------] 20.6% ...\r",
"[=====-------------------] 20.9% ...\r",
"[=====-------------------] 21.2% ...\r",
"[=====-------------------] 21.4% ...\r",
"[=====-------------------] 21.7% ...\r",
"[=====-------------------] 22.0% ...\r",
"[=====-------------------] 22.3% ...\r",
"[=====-------------------] 22.6% ...\r",
"[=====-------------------] 22.8% ...\r",
"[======------------------] 23.1% ...\r",
"[======------------------] 23.4% ...\r",
"[======------------------] 23.7% ...\r",
"[======------------------] 24.0% ...\r",
"[======------------------] 24.2% ...\r",
"[======------------------] 24.5% ...\r",
"[======------------------] 24.8% ...\r",
"[======------------------] 25.1% ...\r",
"[======------------------] 25.3% ...\r",
"[======------------------] 25.6% ...\r",
"[======------------------] 25.9% ...\r",
"[======------------------] 26.2% ...\r",
"[======------------------] 26.5% ...\r",
"[======------------------] 26.7% ...\r",
"[======------------------] 27.0% ...\r",
"[=======-----------------] 27.3% ...\r",
"[=======-----------------] 27.6% ...\r",
"[=======-----------------] 27.9% ...\r",
"[=======-----------------] 28.1% ...\r",
"[=======-----------------] 28.4% ...\r",
"[=======-----------------] 28.7% ...\r",
"[=======-----------------] 29.0% ...\r",
"[=======-----------------] 29.2% ...\r",
"[=======-----------------] 29.5% ...\r",
"[=======-----------------] 29.8% ...\r",
"[=======-----------------] 30.1% ...\r",
"[=======-----------------] 30.4% ...\r",
"[=======-----------------] 30.6% ...\r",
"[=======-----------------] 30.9% ...\r",
"[=======-----------------] 31.2% ...\r",
"[========----------------] 31.5% ...\r",
"[========----------------] 31.8% ...\r",
"[========----------------] 32.0% ...\r",
"[========----------------] 32.3% ...\r",
"[========----------------] 32.6% ...\r",
"[========----------------] 32.9% ...\r",
"[========----------------] 33.1% ...\r",
"[========----------------] 33.4% ...\r",
"[========----------------] 33.7% ...\r",
"[========----------------] 34.0% ...\r",
"[========----------------] 34.3% ...\r",
"[========----------------] 34.5% ...\r",
"[========----------------] 34.8% ...\r",
"[========----------------] 35.1% ...\r",
"[========----------------] 35.4% ...\r",
"[=========---------------] 35.7% ...\r",
"[=========---------------] 35.9% ...\r",
"[=========---------------] 36.2% ...\r",
"[=========---------------] 36.5% ...\r",
"[=========---------------] 36.8% ...\r",
"[=========---------------] 37.0% ...\r",
"[=========---------------] 37.3% ...\r",
"[=========---------------] 37.6% ...\r",
"[=========---------------] 37.9% ...\r",
"[=========---------------] 38.2% ...\r",
"[=========---------------] 38.4% ...\r",
"[=========---------------] 38.7% ...\r",
"[=========---------------] 39.0% ...\r",
"[=========---------------] 39.3% ...\r",
"[=========---------------] 39.6% ...\r",
"[==========--------------] 39.8% ...\r",
"[==========--------------] 40.1% ...\r",
"[==========--------------] 40.4% ...\r",
"[==========--------------] 40.7% ...\r",
"[==========--------------] 40.9% ...\r",
"[==========--------------] 41.2% ...\r",
"[==========--------------] 41.5% ...\r",
"[==========--------------] 41.8% ...\r",
"[==========--------------] 42.1% ...\r",
"[==========--------------] 42.3% ...\r",
"[==========--------------] 42.6% ...\r",
"[==========--------------] 42.9% ...\r",
"[==========--------------] 43.2% ...\r",
"[==========--------------] 43.5% ...\r",
"[==========--------------] 43.7% ...\r",
"[===========-------------] 44.0% ...\r",
"[===========-------------] 44.3% ...\r",
"[===========-------------] 44.6% ...\r",
"[===========-------------] 44.8% ...\r",
"[===========-------------] 45.1% ...\r",
"[===========-------------] 45.4% ...\r",
"[===========-------------] 45.7% ...\r",
"[===========-------------] 46.0% ...\r",
"[===========-------------] 46.2% ...\r",
"[===========-------------] 46.5% ...\r",
"[===========-------------] 46.8% ...\r",
"[===========-------------] 47.1% ...\r",
"[===========-------------] 47.4% ...\r",
"[===========-------------] 47.6% ...\r",
"[===========-------------] 47.9% ...\r",
"[============------------] 48.2% ...\r",
"[============------------] 48.5% ...\r",
"[============------------] 48.7% ...\r",
"[============------------] 49.0% ...\r",
"[============------------] 49.3% ...\r",
"[============------------] 49.6% ...\r",
"[============------------] 49.9% ...\r",
"[============------------] 50.1% ...\r",
"[============------------] 50.4% ...\r",
"[============------------] 50.7% ...\r",
"[============------------] 51.0% ...\r",
"[============------------] 51.3% ...\r",
"[============------------] 51.5% ...\r",
"[============------------] 51.8% ...\r",
"[=============-----------] 52.1% ...\r",
"[=============-----------] 52.4% ...\r",
"[=============-----------] 52.6% ...\r",
"[=============-----------] 52.9% ...\r",
"[=============-----------] 53.2% ...\r",
"[=============-----------] 53.5% ...\r",
"[=============-----------] 53.8% ...\r",
"[=============-----------] 54.0% ...\r",
"[=============-----------] 54.3% ...\r",
"[=============-----------] 54.6% ...\r",
"[=============-----------] 54.9% ...\r",
"[=============-----------] 55.2% ...\r",
"[=============-----------] 55.4% ...\r",
"[=============-----------] 55.7% ...\r",
"[=============-----------] 56.0% ...\r",
"[==============----------] 56.3% ...\r",
"[==============----------] 56.5% ...\r",
"[==============----------] 56.8% ...\r",
"[==============----------] 57.1% ...\r",
"[==============----------] 57.4% ...\r",
"[==============----------] 57.7% ...\r",
"[==============----------] 57.9% ...\r",
"[==============----------] 58.2% ...\r",
"[==============----------] 58.5% ...\r",
"[==============----------] 58.8% ...\r",
"[==============----------] 59.1% ...\r",
"[==============----------] 59.3% ...\r",
"[==============----------] 59.6% ...\r",
"[==============----------] 59.9% ...\r",
"[==============----------] 60.2% ...\r",
"[===============---------] 60.4% ...\r",
"[===============---------] 60.7% ...\r",
"[===============---------] 61.0% ...\r",
"[===============---------] 61.3% ...\r",
"[===============---------] 61.6% ...\r",
"[===============---------] 61.8% ...\r",
"[===============---------] 62.1% ...\r",
"[===============---------] 62.4% ...\r",
"[===============---------] 62.7% ...\r",
"[===============---------] 63.0% ...\r",
"[===============---------] 63.2% ...\r",
"[===============---------] 63.5% ...\r",
"[===============---------] 63.8% ...\r",
"[===============---------] 64.1% ...\r",
"[===============---------] 64.3% ...\r",
"[================--------] 64.6% ...\r",
"[================--------] 64.9% ...\r",
"[================--------] 65.2% ...\r",
"[================--------] 65.5% ...\r",
"[================--------] 65.7% ...\r",
"[================--------] 66.0% ...\r",
"[================--------] 66.3% ...\r",
"[================--------] 66.6% ...\r",
"[================--------] 66.9% ...\r",
"[================--------] 67.1% ...\r",
"[================--------] 67.4% ...\r",
"[================--------] 67.7% ...\r",
"[================--------] 68.0% ...\r",
"[================--------] 68.2% ...\r",
"[================--------] 68.5% ...\r",
"[=================-------] 68.8% ...\r",
"[=================-------] 69.1% ...\r",
"[=================-------] 69.4% ...\r",
"[=================-------] 69.6% ...\r",
"[=================-------] 69.9% ...\r",
"[=================-------] 70.2% ...\r",
"[=================-------] 70.5% ...\r",
"[=================-------] 70.8% ...\r",
"[=================-------] 71.0% ...\r",
"[=================-------] 71.3% ...\r",
"[=================-------] 71.6% ...\r",
"[=================-------] 71.9% ...\r",
"[=================-------] 72.1% ...\r",
"[=================-------] 72.4% ...\r",
"[=================-------] 72.7% ...\r",
"[==================------] 73.0% ...\r",
"[==================------] 73.3% ...\r",
"[==================------] 73.5% ...\r",
"[==================------] 73.8% ...\r",
"[==================------] 74.1% ...\r",
"[==================------] 74.4% ...\r",
"[==================------] 74.7% ...\r",
"[==================------] 74.9% ...\r",
"[==================------] 75.2% ...\r",
"[==================------] 75.5% ...\r",
"[==================------] 75.8% ...\r",
"[==================------] 76.0% ...\r",
"[==================------] 76.3% ...\r",
"[==================------] 76.6% ...\r",
"[==================------] 76.9% ...\r",
"[===================-----] 77.2% ...\r",
"[===================-----] 77.4% ...\r",
"[===================-----] 77.7% ...\r",
"[===================-----] 78.0% ...\r",
"[===================-----] 78.3% ...\r",
"[===================-----] 78.6% ...\r",
"[===================-----] 78.8% ...\r",
"[===================-----] 79.1% ...\r",
"[===================-----] 79.4% ...\r",
"[===================-----] 79.7% ...\r",
"[===================-----] 79.9% ...\r",
"[===================-----] 80.2% ...\r",
"[===================-----] 80.5% ...\r",
"[===================-----] 80.8% ...\r",
"[===================-----] 81.1% ...\r",
"[====================----] 81.3% ...\r",
"[====================----] 81.6% ...\r",
"[====================----] 81.9% ...\r",
"[====================----] 82.2% ...\r",
"[====================----] 82.5% ...\r",
"[====================----] 82.7% ...\r",
"[====================----] 83.0% ...\r",
"[====================----] 83.3% ...\r",
"[====================----] 83.6% ...\r",
"[====================----] 83.8% ...\r",
"[====================----] 84.1% ...\r",
"[====================----] 84.4% ...\r",
"[====================----] 84.7% ...\r",
"[====================----] 85.0% ...\r",
"[====================----] 85.2% ...\r",
"[=====================---] 85.5% ...\r",
"[=====================---] 85.8% ...\r",
"[=====================---] 86.1% ...\r",
"[=====================---] 86.4% ...\r",
"[=====================---] 86.6% ...\r",
"[=====================---] 86.9% ...\r",
"[=====================---] 87.2% ...\r",
"[=====================---] 87.5% ...\r",
"[=====================---] 87.7% ...\r",
"[=====================---] 88.0% ...\r",
"[=====================---] 88.3% ...\r",
"[=====================---] 88.6% ...\r",
"[=====================---] 88.9% ...\r",
"[=====================---] 89.1% ...\r",
"[=====================---] 89.4% ...\r",
"[======================--] 89.7% ...\r",
"[======================--] 90.0% ...\r",
"[======================--] 90.3% ...\r",
"[======================--] 90.5% ...\r",
"[======================--] 90.8% ...\r",
"[======================--] 91.1% ...\r",
"[======================--] 91.4% ...\r",
"[======================--] 91.6% ...\r",
"[======================--] 91.9% ...\r",
"[======================--] 92.2% ...\r",
"[======================--] 92.5% ...\r",
"[======================--] 92.8% ...\r",
"[======================--] 93.0% ...\r",
"[======================--] 93.3% ...\r",
"[======================--] 93.6% ...\r",
"[=======================-] 93.9% ...\r",
"[=======================-] 94.2% ...\r",
"[=======================-] 94.4% ...\r",
"[=======================-] 94.7% ...\r",
"[=======================-] 95.0% ...\r",
"[=======================-] 95.3% ...\r",
"[=======================-] 95.5% ...\r",
"[=======================-] 95.8% ...\r",
"[=======================-] 96.1% ...\r",
"[=======================-] 96.4% ...\r",
"[=======================-] 96.7% ...\r",
"[=======================-] 96.9% ...\r",
"[=======================-] 97.2% ...\r",
"[=======================-] 97.5% ...\r",
"[=======================-] 97.8% ...\r",
"[========================] 98.1% ...\r",
"[========================] 98.3% ...\r",
"[========================] 98.6% ...\r",
"[========================] 98.9% ...\r",
"[========================] 99.2% ...\r",
"[========================] 99.4% ...\r",
"[========================] 99.7% ...\r"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Traceback (most recent call last):\n",
" File \"tools/prepare_dataset.py\", line 115, in <module>\n",
" db.save_imglist(args.target, root=args.root_path)\n",
" File \"/home/ec2-user/SageMaker/incubator-mxnet/example/ssd/tools/../dataset/imdb.py\", line 113, in save_imglist\n",
" raise RuntimeError(\"No image in imdb\")\n",
"RuntimeError: No image in imdb\n"
]
}
],
"source": [
"%%bash\n",
"cd incubator-mxnet/example/ssd\n",
"python tools/prepare_dataset.py --year 2018 --set=training --target ./data/train.lst"
]
},
{
"cell_type": "code",
"execution_count": 72,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "conda_mxnet_p36",
"language": "python",
"name": "conda_mxnet_p36"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment