Skip to content

Instantly share code, notes, and snippets.

View Nikronic's full-sized avatar
🌌
Outlasting RNGs

Nikan Doosti Nikronic

🌌
Outlasting RNGs
View GitHub Profile
@Nikronic
Nikronic / tar_reader_pytorch.py
Last active June 8, 2019 13:51
How to read a .tar file as a dataset using Pytorch
"""
# Mohammad Doosti Lakhani - 2019
Hi,
This works if you have image dataset in `.tar` file.
You have to have a `.csv` or `.txt` file, including a name per line of your dataset.
"""
from PIL import Image

There are several approaches

  • Mount Google Drive in local Colab VM
  • Upload and download via browser
  • Use colab_util.py in python script