Skip to content

Instantly share code, notes, and snippets.

View vfdev-5's full-sized avatar
:octocat:
.\ |

vfdev vfdev-5

:octocat:
.\ |
View GitHub Profile
#!/usr/bin/env python
# coding: utf-8
opt_level = "O1"
import torch
print(torch.__version__)
import ignite
ignite.__file__
@vfdev-5
vfdev-5 / README.md
Last active August 14, 2023 11:00
ROS development on MacOSX using docker

ROS development on MacOSX using docker

We need to use docker-machine to handle USB ports inside the docker.

Docker Machine (0.16.1)

@vfdev-5
vfdev-5 / reproduce_error.py
Last active March 6, 2019 18:43
TypeError: _queue_reduction(): incompatible function arguments. The following argument types are supported:
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
@vfdev-5
vfdev-5 / notes_pytorch_distributed.md
Created February 26, 2019 15:01
Notes on PyTorch distributed

Some notes on launching distributed computations with PyTorch

  • Inside a docker container
  • Using NCCL and TCP or Shared file-system
  • PyTorch version: 1.0.1.post2
  • 2 Nodes / 3 GPUs

Docker container

We need to run the container with --network=host option

@vfdev-5
vfdev-5 / README.md
Last active March 5, 2020 16:47
How to remotely debug C++ program from VSCode
@vfdev-5
vfdev-5 / fast_resnet.py
Last active January 9, 2019 23:20
PyTorch model's implementations compare by forward time
# 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)
@vfdev-5
vfdev-5 / accuracy.py
Created December 25, 2018 19:57
Custom ignite metrics : Accuracy/Precision/Recall with multilabel option
from __future__ import division
import torch
from ignite.metrics.metric import Metric
from ignite.exceptions import NotComputableError
class _BaseClassification(Metric):
@vfdev-5
vfdev-5 / how_to_run.md
Last active August 17, 2018 22:05
Ignite training with online metrics profiling

Just run as

python -m cProfile -o run.prof script.py
@vfdev-5
vfdev-5 / Dockerfile
Created July 18, 2018 21:00
Dockerfile with ROS Kinetic + UR5
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
@vfdev-5
vfdev-5 / Ignite_on_Fruits_360.ipynb
Last active August 23, 2018 13:18
57a7df109590e195800d980b1dfafb4c
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.