Skip to content

Commit 192ef0c

Browse files
committed
Update test_model_framework_tensorflow_model.py to create keras cache data dir.
1 parent d469205 commit 192ef0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/unitary/with_extras/model/test_model_framework_tensorflow_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ class MyTFModel:
4949
"Timeout when waiting for MNIST data to finished downloading in another process. "
5050
"Please check internet connection."
5151
)
52+
os.makedirs(os.path.dirname(lock_file), exist_ok=True)
5253
Path(lock_file).touch()
5354
(x_train, y_train), (x_test, y_test) = mnist.load_data()
5455
finally:
55-
os.unlink(lock_file)
56+
if os.path.exists(lock_file):
57+
os.unlink(lock_file)
5658

5759
x_train, x_test = x_train / 255.0, x_test / 255.0
5860

0 commit comments

Comments
 (0)