google-research / meta-dataset

A dataset of datasets for learning to learn from few examples
Apache License 2.0
762 stars 139 forks source link

Dataset download: Couldn't extract ILSVRC2012_img_train/n????????.tar using the script in doc #89

Open letyrodridc opened 2 years ago

letyrodridc commented 2 years ago

The section dataset download and conversion proposes a script for extracting ILSVRC2012 .tar in the corresponding directory. Link to the wikipage: https://github.com/google-research/meta-dataset/blob/main/doc/dataset_conversion.md#ilsvrc_2012

Script:

for FILE in *.tar;
do
  mkdir ${FILE/.tar/};
  cd ${FILE/.tar/};
  tar xvf ../$FILE;
  cd ..;
done

It didn't work for me. I used instead:

for FILE in *.tar;
do

  TARGET=`echo "$FILE" | sed 's/\.tar//'`;

  mkdir $TARGET;
  cd ${TARGET};
  tar xvf ../$FILE;
  cd ..;
done
vdumoulin commented 2 years ago

Thank you for pointing this out! Perhaps there are some differences between shells in how pattern replacement in variables behave? In any case, I'll add a mention of that in the documentation.