Detecting tree and wire entanglements with deep learning