Robotic manipulators are increasingly being used for performing a wide variety of manufacturing processes. Some of the manufacturing processes performed using robotic manipulators require high trajectory execution accuracy. Automatically generated trajectories often exhibit significant execution errors due to robot model inaccuracies and controller behaviors. This suggests that a trajectory compensation scheme can be used to modify trajectory to reduce execution error. Unfortunately, the nature of the trajectory and the end-effector loading affect the trajectory tracking errors. So, the error reduction using a trajectory-independent automated compensation scheme does not always work. Our paper presents a method to sample the input trajectory, generate the training data by measuring the sampled trajectory execution, and learning the compensation scheme based on the physical run. The learned trajectory-dependent compensation scheme is capable of reducing the execution error. To demonstrate the compensation scheme’s effectiveness, we perform experiments on manipulators. After the trajectory compensation, the manipulator has considerably low trajectory execution errors, with the average path error close to the robot’s repeatability.