Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not right. What if the expected shape is really 3-D? In addition, tensorflow internally can do reshape. Why can't we put the weight on tensorflow's shoulder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it doesn't. At least for image models we use.
I'm actually not sure why, considering what usually models have variable tensors like [?,224,224,3], but in one which samples has problems they have [1,224,224,3]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we need to fix those models or edit them before their execution. It's not ideal to have an assumption which is true only for some image models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ivanidzo4ka, I agree with @wschin. It will create problems for models that don't have batch dimension. There were a couple of issues related to that on github. I already talked to @shauheen and @CESARDELATORRE on this and proposed following solution.
The ultimate solution is to have a reshape transform that user can use to reshape their data. However, the temporary solution would be to add a parameter in options class called “AddBatchDimensionOnInput”. When user set it to true, batch dimension would be added to the inputs otherwise not.
Can you instead do it for now in this PR? We can then discuss adding reshape transform later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the inception model from google.
https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip
Which takes input data of any shape. So we cannot infer shape from the input. There is a convolution layer just after the input which requires 4-D input and that's the problem.