Skip to content

Instantly share code, notes, and snippets.

@wconstab
wconstab / maskrcnn_failure
Created September 25, 2020 02:06
Error from maskrcnn in CI
=================================== FAILURES ===================================
__________ TestBenchNetwork.test_eval[maskrcnn_benchmark-cuda-eager] ___________
self = <test_bench.TestBenchNetwork object at 0x7fd908efa6d0>
hub_model = <torchbenchmark.models.maskrcnn_benchmark.Model object at 0x7fd8f231d3d0>
benchmark = <pytest_benchmark.fixture.BenchmarkFixture object at 0x7fd8e9d433d0>
def test_eval(self, hub_model, benchmark):
try:
> benchmark(hub_model.eval)
@wconstab
wconstab / repro-quant-gil.py
Last active August 1, 2020 00:11
Repro for PyTorch issue #41865
import torch
import torch.nn as nn
from concurrent.futures import ThreadPoolExecutor
import time
import argparse
from tabulate import tabulate
class Model(nn.Module):
def __init__(self, in_f, out_f, hidden=1000, layers=10):
super().__init__()
from multiprocessing import Process
import rpdb
def f():
print("Hello")
rpdb.set_trace()
print("next")
@wconstab
wconstab / load_data.py
Created March 10, 2016 08:20
Load image files in class-label subdirs into X, y pair of buffers for use with ArrayIterator
import cv2
import numpy as np
import os
import argparse
import cPickle
def decode_image(filename, dim=32):
"""
Helper function to read an image file and return it as a flattened (CHW) array
"""
@wconstab
wconstab / cifar10_allcnn.py
Last active January 20, 2016 01:40
cifar10_allcnn.py
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software