Skip to content

Commit 5553d67

Browse files
author
David Cavazos
authored
ppai/timeseries-classification: use smaller batch size for tests (GoogleCloudPlatform#6799)
* ppai/image-classification: add exponential retries to download file * decrease batch size for tests * print the job url if it fails
1 parent b89f503 commit 5553d67

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

people-and-planet-ai/timeseries-classification/e2e_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def create_datasets(
259259
time.sleep(POLL_INTERVAL_SEC)
260260

261261
logging.info(f"Datasets job finished with status {status}")
262-
assert status == DATAFLOW_SUCCESS_STATE
262+
assert status == DATAFLOW_SUCCESS_STATE, f"job_url: {job_url}"
263263
yield job_id
264264

265265

@@ -268,7 +268,7 @@ def train_model(service_url: str, access_token: str, create_datasets: str) -> st
268268
response = requests.post(
269269
url=f"{service_url}/train-model",
270270
headers={"Authorization": f"Bearer {access_token}"},
271-
json={"train_epochs": 100},
271+
json={"train_epochs": 10, "batch_size": 8},
272272
).json()
273273
logging.info(f"train_model response: {response}")
274274

@@ -295,7 +295,7 @@ def train_model(service_url: str, access_token: str, create_datasets: str) -> st
295295
time.sleep(POLL_INTERVAL_SEC)
296296

297297
logging.info(f"Model job finished with status {status}")
298-
assert status == VERTEX_AI_SUCCESS_STATE
298+
assert status == VERTEX_AI_SUCCESS_STATE, f"job_url: {job_url}"
299299
yield job_id
300300

301301

people-and-planet-ai/timeseries-classification/local_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def test_e2e_local() -> None:
9696
model_dir=model_dir,
9797
tensorboard_dir=tensorboard_dir,
9898
checkpoint_dir=checkpoint_dir,
99-
train_epochs=10,
100-
batch_size=32,
99+
train_epochs=2,
100+
batch_size=8,
101101
)
102102
assert os.listdir(model_dir), "no model files found"
103103
assert os.listdir(tensorboard_dir), "no tensorboard files found"

0 commit comments

Comments
 (0)