aws / aws/amazon-sagemaker-examples

How to specify the number of epoch using custom estimator.Tensorflow object?

Open
#659 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

Dear AWS team,

I am trying to train a custom tensoflow estimator with the . I am using pipemode dataset as the input.

I wish I can have an evaluation result at the end of each epoch during the training. Wondering what is the currect way to specify the hyper parameter epoch number?

```
from sagemaker.tensorflow import TensorFlow
import os
source_dir = os.path.join(os.getcwd(), 'source_dir')

cnn_estimator = TensorFlow(entry_point='estimator.py',
source_dir=source_dir,
role=role,
framework_version='1.12.0',
#checkpoint_path = model_artifacts_location,
input_mode='Pipe',
hyperparameters={'throttle_secs': 10, 'epoch':2},
output_path=model_artifacts_location,
code_location=custom_code_upload_location,
train_instance_count=1,
training_steps=None,
evaluation_steps=VALID_STEP,
train_instance_type='ml.c5.xlarge')

```
Method currently using inside the train_input_fn()
```
ds = PipeModeDataset(channel)
ds = ds.batch(2)
ds = ds.map(parse)
ds = ds.batch(64)
ds = ds.repeat(params['epoch'])
```

Thank you very much

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.