what is the meaning of np.expand_dims(x,axis=0) why we are using this?
What is the meaning of np.expand_dims(x,axis=0) why we are using this?
Hey @hssharma2212000, expand_dims as the name suggests is used the expand the dimensions, say like x has shape of (224,224,3) and after using x = np.expand_dims(x,axis=0) the new shape of x will be
(1,224,224,3)
This was done, because model make predictions only on, input vector of having shape as
(number of example, 224,224,3).
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.