Sequence Model week 3 assignment 2

Hello,
For week 3 UNQ_C4, I am getting AssertionError: Spectrogram is wrong. Check the parameters passed to the insert_audio_clip function. My inputs to the function are background, one_random_activate, previous_segments. Please help if these are not correct.

There are lots of potential causes besides that one hint.

Also check that you’re correctly using the return values correctly that insert_audio_clip() provides.

Note that insert_audio_clip() should be used in Step 3 and in Step 4 in create_training_example(). But it doesn’t use the same arguments each time.

To get segment_start and segment_end I am using get_random_time_segment(segment_time[0]). This is likely wrong. Any hints?

Thanks you,
Amy

Yes, that’s an error.

The argument for get_random_time_segment() should always be segment_ms.

In Step 1, you get an initial random time segment.

In Step 2, you check if that segment_time is good. If it isn’t, you get a new random time segment and try again.