Skip to content

Fix the Attribute Error in Differentially private CNN on MNIST example notebook - #1739

Open
rajasekharporeddy wants to merge 1 commit into
google-deepmind:mainfrom
rajasekharporeddy:differentially_private_sgd
Open

Fix the Attribute Error in Differentially private CNN on MNIST example notebook#1739
rajasekharporeddy wants to merge 1 commit into
google-deepmind:mainfrom
rajasekharporeddy:differentially_private_sgd

Conversation

@rajasekharporeddy

Copy link
Copy Markdown
Collaborator

Currently the differentially_private_sgd.ipynb example notebook fails with an attribute error during the training while iterating over the train_loader_batched dataset since it does not have the attribute as_numpy_iterator().

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_1514/3612508851.py in <cell line: 0>()
      2 
      3 for epoch in range(NUM_EPOCHS):
----> 4   for batch in train_loader_batched.as_numpy_iterator():
      5     params, opt_state = train_step(params, opt_state, batch)
      6 

AttributeError: 'BatchMapDataset' object has no attribute 'as_numpy_iterator'

@rajasekharporeddy
rajasekharporeddy requested a review from rdyro August 3, 2026 09:57

@rdyro rdyro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants