Reference implementation of PyTorch ImageNet Inferencing

This is a seemingly stupid request for all post-post-doc AI researchers on here, but hear me out.

First thing that DL Newbies look for is an image inferencing example. Inferencing is computationally cheap and has a high WOW :star_struck: factor, which makes it the perfect “Hello World” for DL.

We have the reference PyTorch ImageNet training code on Github, but we don’t have a reference ImageNet inferencing example. If someone has an elegant, memory efficient CPU + GPU inferencing code sitting around please submit a PR and add it to the examples repo!


1 Like

I have a pretty lean inference script included with a DPN conversion I recently posted at

It utilizes a Dataset that’s fine with images in arbitrary folder hierarchies, from flat to many levels. The script dumps top-5 prediction (by class id) to a csv file.

1 Like

By inferencing you mean making a prediction for new sample? Sure, I’ll add it to the tutorial I wrote for fine tuning. The tutorial currently only does training. This is a good idea. Here’s the repo for now -

1 Like

Your inferencing example looks epic Mr Wightman! You should submit it to PyTorch Examples repo below. (Perhaps inside “imagenet” folder, since your code / arguments match training script inside the folder?)

By the way, I missed the DPN paper this summer - thanks for the implementation! I have starred it and will check it out more.