From e7d0f60dae9e6109201dae2e2077ea98ae050361 Mon Sep 17 00:00:00 2001
From: Alex Lee <alexleegk@gmail.com>
Date: Tue, 10 Apr 2018 10:01:12 -0700
Subject: [PATCH] Python 2 compatibility of preprocessing script.

---
 data/download_and_preprocess_dataset.sh  | 3 +++
 video_prediction/datasets/kth_dataset.py | 3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/data/download_and_preprocess_dataset.sh b/data/download_and_preprocess_dataset.sh
index 8878b01b..93652923 100644
--- a/data/download_and_preprocess_dataset.sh
+++ b/data/download_and_preprocess_dataset.sh
@@ -1,5 +1,8 @@
 #!/usr/bin/env bash
 
+# exit if any command fails
+set -e
+
 if [ "$#" -ne 1 ]; then
   echo "Usage: $0 DATASET_NAME" >&2
   exit 1
diff --git a/video_prediction/datasets/kth_dataset.py b/video_prediction/datasets/kth_dataset.py
index f350f53e..44e73912 100644
--- a/video_prediction/datasets/kth_dataset.py
+++ b/video_prediction/datasets/kth_dataset.py
@@ -117,8 +117,7 @@ def main():
     for partition_name, partition_fnames in zip(partition_names, partition_fnames):
         partition_dir = os.path.join(args.output_dir, partition_name)
         if not os.path.exists(partition_dir):
-            os.makedirs(partition_dir, exist_ok=True)
-
+            os.makedirs(partition_dir)
         read_videos_and_save_tf_records(partition_dir, partition_fnames)
 
 
-- 
GitLab