federated icon indicating copy to clipboard operation
federated copied to clipboard

Can't instantiate abstract class MnistModel with abstract methods federated_output_computation, report_local_outputs

Open selfcontrol7 opened this issue 2 years ago • 2 comments

While trying to run the Federated Learning for Image Classification with the provided colab notebook, the bellow error appears when running this cell on the simulation of federated training with the new model.

TypeError: Can't instantiate abstract class MnistModel with abstract methods federated_output_computation, report_local_outputs

This error seems to come from the tff.learning.Model instance created here.

Please, is there any way to fix the bug? Below is a capture as well.

Thank you

Bug .

selfcontrol7 avatar Mar 20 '22 13:03 selfcontrol7

It looks to me like we've deprecated these attributes since our last release.

One way we've handled (well, since TFF is developed at HEAD inside of Google, 'handled' is being a little generous to us) this issue is to direct the links from the main TFF website to the colab notebooks, not at the main branch, but at the last released version. In this case, this would take you here, which is a version of the tutorial which works with the last release.

The issue surfacing here is essentially rearing its head since we deprecated our TFF-nightly package, which was generally to avoid dependency conflicts. I suspect we may return to explicitly pinning the links from our documentation to a released version, and updating these links when we do a release. I'll assign this to myself, and hope to get to this tomorrow.

jkr26 avatar Mar 21 '22 03:03 jkr26

So what is the new name of federated_output_computation?

mahimairaja avatar Oct 02 '23 20:10 mahimairaja