Artificial intelligence corrects 3D printing mistakes in real time