C3W2, zombie detector doesn't converge

Hi,

I am working on the zombie lab, having gone through all the previous steps and it looks correct, but I met issues when doing the fine tuning, the model doesn’t converge by trying several times, one result is as attached, I am unable to find the reason, can someone help me? thank you!

hi @Florawang
this topic thread should help you debug your codes.

Solution

Check your defining path and checkpoint path.

Let me know if issue still persist

Thank you for your help!

I checked the config path and checkpoint path, added ‘/content‘ before ‘/model/…’ , the only difference, but still got the same output in 6.1 as :tensorflow.python.checkpoint.checkpoint.Checkpoint

# Expected output:

# tensorflow.python.training.tracking.util.Checkpoint

And same in 6.2 , the output of type(tmp_model_checkpoint) is not as expected as above.

hi @Florawang

I have gone through your sent codes but you have only sent a part of the section assignment, I have replied in DM to send all exercise code screenshots.

Now coming to what you sent till now, most of the codes are right but some codes placement especially where one calculate loss is placed incorrectly, so just in case any editing or removal or addition is done beyond the markers ###START AND END CODE HERE###, I recommend you re-do your assignment by making sure only to write codes between these markets.

Also I am sharing a post comment link which explains object detection in detail, it might help you understand it better.

Link OD

Please send me further codes, so can give a detail response where all corrections is required.

also note with the pipeline and restoring checkpoint, adding content is based on file names, so if in your case it is not present, then that correction was not required.

This is the instruction given :backhand_index_pointing_down:t2:

"Move the decompressed checkpoint to models/research/object_detection/test_data/

so make sure first check how you imported and downloaded your configuration files.(Read the pinned link here I have explained it in detail there)

hi @Florawang

after reviewing you complete assignment, I happy to inform that most of your codes were correct except please make some.changes in where it mentions modify the num_classes from default, you have used the numerical value instead used the recall variable.

Also in your case for pipeline and checkpoint path, you need to use the content as you named the img.dir as content/training.

Next while creating dummy images, please remove the datatype mention tf.float32

while restoring checkpoint path, please remove the extra partial.

Another slight modification which might be reasonable you have mentioned the calculation of total loss before making the prediction, so change the position of these two codes.

Also if you are making changes in the older copy you worked make sure you clear out the kernel output and reconnect the kernel, then run each code cell from beginning till end. Otherwise re-doing the assignment with the mentioned correction is better recommendation.

Let me know if you still are stuck.

Regards
DP

Hi DP,

Thank you very much for your suggestion. I have checked each item as you mentioned:

  1. modify the num_classes from default, done.
  2. pipeline and checkpoint path, I used the same path started with “/content/..“
  3. while creating dummy images, please remove the datatype mention tf.float32, done
  4. restoring checkpoint path, please remove the extra partial. done
  5. “Another slight modification which might be reasonable you have mentioned the calculation of total loss before making the prediction, so change the position of these two codes.” I checked the code, it is firstly doing prediction to get the prediction_dict, and then calculate the total_losses.
  6. I have restarted from the beginning and rerun again, but got the similar issue.

And the issue with the type is same as before:

Is that because of some version update?

I want you to make one more change where you wrote the fine tune list to select the prediction layer, use detection_model.trainable_variables to enlist the layers. I used 4 layers and remember indexing is 0,1, 2, 3

Also I forgot to mention somewhere you have mentioned add_summaries as True that also need to be removed in the build custom build.

Okay I see your checkpoint is the issue, probably because you added the parameter add_summaries=True to your custom model is creating multiple checkpoints.

Hi,

detection_model.trainable_variables should be correct, since the test code passed. But I changed it as you said with append for the first 4 layers. And the issue with the type is same as above.

add_summaries=True has been removed.

And I restarted and run several times, the result is even worse.

It takes me several days for now, I just wonder if this issue related to the version change or the colab environment ? since it can only be run with cpu, which is rather slow..

And I saw the object detection API is not maintained from the official website, should we continue this lab as this? Or do you have better suggestion on object detection project/tasks ?

please DM me how you did the correction for the list and the total loss calculation