0

I would like to print (before training) the state of model : with print(state['model']), I found this error :

TypeError: 'ServerState' object is not subscriptable

seni
  • 659
  • 1
  • 8
  • 20

1 Answers1

2

tff.leraning.framework.ServerState is a Python attrs class, whos fields are accessed via the Instance.method (__getattr_) syntax, rather than the Instance['key'] lookup (__getitem__).

Try replacing print(state['model']) with print(state.model).

Zachary Garrett
  • 2,911
  • 15
  • 23