We need to use docker-machine to handle USB ports inside the docker.
- Install docker-machine: https://docs.docker.com/machine/install-machine/
- Docker version: 18.09.2, build 6247962
- Install virtualbox >= 6.0
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| opt_level = "O1" | |
| import torch | |
| print(torch.__version__) | |
| import ignite | |
| ignite.__file__ |
We need to use docker-machine to handle USB ports inside the docker.
| from __future__ import print_function | |
| import argparse | |
| import random | |
| import torch | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| import torch.nn.functional as F |
Good references:
The setup:
| # Implementation from https://github.com/davidcpage/cifar10-fast | |
| # Adapted to python 3.5 | |
| # TorchGraph( | |
| # (prep_conv): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False) | |
| # (prep_bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) | |
| # (prep_relu): ReLU(inplace) | |
| # (layer1_conv): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False) | |
| # (layer1_bn): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) | |
| # (layer1_relu): ReLU(inplace) |
| from __future__ import division | |
| import torch | |
| from ignite.metrics.metric import Metric | |
| from ignite.exceptions import NotComputableError | |
| class _BaseClassification(Metric): |
Just run as
python -m cProfile -o run.prof script.py
| FROM osrf/ros:kinetic-desktop-xenial | |
| MAINTAINER vfdev-5 | |
| LABEL version="0.1" | |
| LABEL description="ROS-kinetic and UR package" | |
| # Update all | |
| RUN apt-get update |