tensorflow / tensorflow/privacy

ValueError: Dimension size must be evenly divisible by 250 but is 1 for '{{node Reshape}}

Open
#287 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
477
Avg merge
22h 12m
Merged PRs (30d)
1

Description

Hello Community,

I'm currently working on a project which requires me to include differential privacy. While I try to implement it using tf privacy, I become an error message:

ValueError: Dimension size must be evenly divisible by 250 but is 1 for '{{node Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32](sparse_categorical_crossentropy/weighted_loss/value, Reshape/shape)' with input shapes: [], [2] and with input tensors computed as partial shapes: input[1] = [250,?].

The error takes place in line 381 where the model should be fitted. Because my code is over 400 lines long and I have no clue which lines are interesting, I will share it with you via codeshare: https://codeshare.io/mpvkVj

If the issue gets resolved, I will include the interesting lines later on. Thank you very much for every hint 😃

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the model-fitting call at line 381 and inspect the shared Codeshare example alongside the reported Reshape error. Trace the tensors involved in the weighted loss and identify the relevant minimal lines; done means the cause is reproducible and clearly explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
machine-learning, python
Domain
machine-learning, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.