aashma uprety
aashma uprety

Reputation: 53

AttributeError: 'collections.OrderedDict' object has no attribute 'train'

with summary_writer.as_default():
  for round_num in range(1, NUM_ROUNDS):
    state, metrics = iterative_process.next(state, federated_train_data)
    # for name, value in metrics.train._asdict().items():
    tf.summary.scalar('metrics', metrics.train._asdict().itrems(), step=round_num)

I am just stuck here. I am getting error messages as: AttributeError: 'collections.OrderedDict' object has no attribute 'train' Metrics looks like this:

metrics=OrderedDict([('broadcast', ()), ('aggregation', ()), ('train', OrderedDict([('sparse_categorical_accuracy', 0.12695473), ('loss', 3.0522373)]))])

Any help will be highly appreciated.

Upvotes: 2

Views: 2027

Answers (1)

Sean C
Sean C

Reputation: 181

looks like

metrics.train._asdict().itrems()

should be

metrics['train'].items()

Upvotes: 1

Related Questions