You should separate $DIR with quotes in 5 row of get_models.sh so it can work when $DIR contains spaces.