diff --git a/official/cv/c3d/preprocess.py b/official/cv/c3d/preprocess.py
index 8a8de2150c4a8fd42e3f848efb73a2ab25c137f3..60a1990c87abc11d9838bea2e2a99dd623d4d807 100644
--- a/official/cv/c3d/preprocess.py
+++ b/official/cv/c3d/preprocess.py
@@ -32,6 +32,8 @@ def gen_bin(data_dir):
     image_path = os.path.join(data_dir, "image")
     label_path = os.path.join(data_dir, "label_bs" + str(config.batch_size) + ".npy")
     label_list = []
+    if not os.path.isdir(image_path):
+        os.makedirs(image_path)
 
     for index, (input_data, label) in enumerate(dataset):
         f_name = "c3d_bs" + str(config.batch_size) + "_" + str(index) + ".bin"