C3W2 Exercise 10 issues

I’m receiving a value error ValueError: Dimension 0 in both shapes must be equal, but are 4 and 2. Shapes are [4,51150,4] and [2,51150,4]. for ‘{{node Loss/Loss/Select}} = Select[T=DT_FLOAT](Loss/Loss/IsNan, concat_2, Loss/stack_10)’ with input shapes: [2,51150,4], [4,51150,4], [2,51150,4].

on exercise 10 I’ve gone through all the reading above the exercise about 10 times now and can’t seem to get it to work. I keep running into an issue on the losses section. I’ve even gone so far as to restart the entire lab to to see if I missed something but still getting the same error. Is there a way I can get some help? Someone to look over my code and see what I’m missing? I’ve tried all the angles I can think of.

3 Likes

Hi Hal! Have you resolved this issue yet?

1 Like

Hello @Hal_Roberts i didnt see this. Usually with this assignment the issues are at exercise 9 at train_step_fn or choice of layers till freeze or some typo.

For now can you send the me the exercise 9 code in private, I will check that!

Excuse me, but I am also having the same issue as @Hal_Roberts. Can you share with me the cause of this problem and how we can solve it? Thank you

1 Like

Please share the screenshot of your error and try to make a new post as these threads are older, so it is better for other learners to learn too.
Please select the appropriate Specialisation, Course, Week and Assignment Name.s’

Adding exercise cell details will save more time for the fellow mentors in helping you a lot.

Regards
DP

2 Likes

I’m running into the same issue. Any hints on how to deal with it?

Thanks.

1 Like

Please share a screenshot of your error. if possible make new topic or post, select the appraise specialisation, course, week and assignment name, so you get prompt reply from mentors of the respective course.

Regards
DP

Thank you for you replay. Deepti_Prasad. I found a solution for my issue and have passed the exam. Thanks again.

1 Like


I’m getting the same error

1 Like

Hello Dharamraj,

Kindly check your total loss codes again. Your codes are incorrect. Try referring the optional ungraded lab and review the videos. Also refer the instructions given in the assignment, your value error is because there is a shape mismatch.

If still unable to get the error, kindly DM your notebook via personal DM. Click on my name and then message.

Regards
DP

can i dm you to show my code?

1 Like

Joel can you share what is the issue here, you got error or any other issue.

sure can you dm me so i can share my code? Thank you!

1 Like

Joel, first share image of the error you are getting.

sure ma’am.

1 Like

Hello Joel,

Kindly review your below grader cell codes again

decorate with @tf.function for faster training (remember, graph mode!)
@tf.function
def train_step_fn(image_list,

especially image tensor codes.

It is stating your dimension 0 should be same in both shapes but are mismatching,.

your preprocessor image tensor and true shape tensor shapes are mismatching.

If still having issue, then kindly DM your notebook. Click on my name and then message.

Regards
DP

to the preprocessd_image_tensor variable i concated preprocessed image list with axis 0. Same with true shape tensor, i concated true shape list. When i checked the length of both, it was 2 for both of those variables…But the batch size is 4 right, so maybe thats the problem ma’am?

1 Like

This is correct, then go back and check if you didn’t hard code true.shape while preprocessing the image in image list

1 Like

it has been done.
first i declared two empty lists for prepcessed image lst and true shape list.
Then i iterated through the g_imgaes_list (there are only two images in this list though, could it be the reason??? cuz batch size is 4) and processed img, true shape as equal to detection model rpeprocess. THen appended processed img into the first lsit . Then true shape was appended into the second list. Again, the input to the g_images_list was automatically set to image_tensor[0:2] by the author. Could this be it?

1 Like

Send me your notebook via personal DM