mlcommons / tiny

MLPerf™ Tiny is an ML benchmark suite for extremely low-power systems such as microcontrollers
https://mlcommons.org/en/groups/inference-tiny/
Apache License 2.0
331 stars 81 forks source link

Anomaly Detection get_datasets.sh not working #159

Open AndreiRoibu-synthara opened 3 months ago

AndreiRoibu-synthara commented 3 months ago

When running the get_datasets.sh, the following error message is printed:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   271  100   271    0     0   4672      0 --:--:-- --:--:-- --:--:--  4754
Archive:  dev_data_ToyCar.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of dev_data_ToyCar.zip or
        dev_data_ToyCar.zip.zip, and cannot find dev_data_ToyCar.zip.ZIP, period.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   285  100   285    0     0   7500      0 --:--:-- --:--:-- --:--:--  7500
Archive:  dev_data_ToyCar.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of dev_data_ToyCar.zip or
        dev_data_ToyCar.zip.zip, and cannot find dev_data_ToyCar.zip.ZIP, period.

Ergo, I am currently unable to run the models. Could you please help? Cheers!

adithya2424 commented 2 months ago

The issue is in the curl command, here are two solutions that worked for me:

Solution 1: Using curl with -Lo instead of -o.

#!/bin/sh

URL1="https://zenodo.org/record/3678171/files/dev_data_ToyCar.zip?download=1"
ZIPFILE="dev_data_ToyCar.zip"

URL2="https://zenodo.org/record/3727685/files/eval_data_train_ToyCar.zip?downlo$

mkdir -p dev_data

curl $URL1 -Lo $ZIPFILE || wget $URL1 -O $ZIPFILE
unzip $ZIPFILE -d dev_data
rm $ZIPFILE

curl $URL2 -Lo $ZIPFILE || wget $URL2 -O $ZIPFILE
unzip $ZIPFILE -d dev_data
rm $ZIPFILE

Solution 2: Using simply the wget command instead of curl.

#!/bin/sh

URL1="https://zenodo.org/record/3678171/files/dev_data_ToyCar.zip?download=1"
ZIPFILE="dev_data_ToyCar.zip"

URL2="https://zenodo.org/record/3727685/files/eval_data_train_ToyCar.zip?downlo$

mkdir -p dev_data

wget $URL1 -O $ZIPFILE
unzip $ZIPFILE -d dev_data
rm $ZIPFILE

wget $URL2 -O $ZIPFILE
unzip $ZIPFILE -d dev_data
rm $ZIPFILE