-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
03 image classification #5192
03 image classification #5192
Conversation
… 03-image_classification
… 03-image_classification
paddle/framework/tensor.h
Outdated
@@ -130,7 +130,10 @@ class Tensor { | |||
return holder_->place(); | |||
} | |||
|
|||
std::type_index type() const { return holder_->type(); } | |||
std::type_index type() const { | |||
PADDLE_ENFORCE_NOT_NULL(holder_, "Tensor get type() must contains holder"); |
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.
"Tensor get type() must contains holder"
==>
"Tensor not initialized yet when Tensor::type() is called."
paddle/operators/batch_norm_op.cc
Outdated
@@ -64,6 +65,9 @@ class BatchNormOp : public framework::OperatorWithKernel { | |||
(tensor_format == TensorFormat::NCHW ? x_dims[1] | |||
: x_dims[x_dims.size() - 1]); | |||
|
|||
PADDLE_ENFORCE(x_dims.size() >= 3 && x_dims.size() <= 5, | |||
"input x dims should be between 3 and 5, actual"); |
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.
Input x must have 3 to 5 dimensions.
@@ -86,6 +86,7 @@ | |||
fetch_list=[avg_cost]) | |||
|
|||
loss = np.array(outs[0]) | |||
print(loss) |
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.
Should we remove or comment out this line?
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.
LGTM
project: #4531
issue: #5100