我想打印(在训练之前)模型的状态:在print(state['model'])中,我发现了这个错误:
TypeError: 'ServerState' object is not subscriptable发布于 2021-05-19 19:29:54
tff.leraning.framework.ServerState是一个Python,它的字段是通过Instance.method (__getattr_)语法访问的,而不是Instance['key'] attrs class (__getitem__)。
尝试用print(state.model)替换print(state['model'])。
https://stackoverflow.com/questions/67602060
复制相似问题