azer:

num_classes = class_logits.shap


Working fine with me.
Yet, copy_if failed to synchronize may be due to incorrect number of classes you used to build the model, and might not be related to the above correction I am suggesting. One reason of this (copy_if failed error), which I have encountered myself, is neglecting the background in the number of classes when building the model. Hence, if you have 10 object categories that you want to detect in your problem (background is neglected), then, you’ll have to build your model to detect 11 classes; that is, the number of classes should be 11.