C1_W3_Assignment # UNQ_C1 unsure of start_x = None(0, None)

I am struggling with UNQ_C1 and in particular

start_x = None(0, None)

My code runs until

Extracting (2, 2, 2) sub-volume

Error: Data-type mismatch.
Error: Wrong shape.
Error: Wrong output.

I am an R programmer rather than python so struggling with numpy arrays.

I’m not a mentor for that course, but maybe I can assist.

What do the instructions say that start_x should be? Please post a screen capture image of the markdown.

Thanks - here is a screenshot from the markdown

image removed as it contains codes that grades your assignment

Sorry, but that’s not the markdown - that’s the code cell.

The markdown cell (probably just above that code cell) should contain the instructions for what code you need to add.

image removed as it contains grade function codes

I now have this output

Not much to go on there. I understand the confusion.

Based on what I can see, it seems they’re expecting you to use np.rand.randint() to generate a random starting index, for each of the x, y, and z dimensions.

Do the instructions include any links to the np.random.randint() documentation? That would be typical for how DL.AI writes its labs.

For example, the start_x value would be randomly selected between 0 and (orig_x - output_x). That way the end of the sample won’t run past the size of the image.

Here’s the definition for np.random.randint(). Note that if you don’t supply a ‘size’ parameter, it defaults to returning one integer value.

I have a solution, thank you

1 Like

Kindly discussion of codes needs to be done in DM especially when sharing about codes as posting codes on public post is considered violation of code of conduct @skiman

Also from future don’t post grade functions codes rather just the error, your output. if mentor wants to look at your codes they will ask you to send by DM

Usually I agree about not sharing code for the assignments.

But in this case, the code that was posted here was from the original assignment as published to learners, without any additional code added.

There were no code for solutions to the assignment included. That’s what the C of C specifically mentions.

Unlisting the thread would have been appropriate, I should have done that myself at the start of the discussion.

1 Like