Generally, structural uncertainty of the robot dynamics system refers to model error caused by parameter identification, unstructured uncertainty is the unmodeled dynamic characteristic. No matter how elaborate modeling methods are used, there always be uncertainty. Therefore, this paper applies deep learning for the first time to aid robot dynamic parameter identification of 6 degrees of freedom robot manipulator for compensation of uncertain factors. Firstly, the relatively accurate prediction of torque is obtained by the physical dynamic model using the parameters identification method (errors are less than 10% of the maximum torques). Secondly, we propose a novel deep neural network based approach called Uncertainty Compensation Model (UCM) to compensate the torque error introduced by the uncertainty. The UCM mainly composed by proposed Input Control Module (ICM) and Error Learning Models (ELMs) based on Long-Short-Term Memory and attention mechanism. The proposed ICM, which effectively avoids the unnecessary interference, is used to control valid input for ELMs. The ELMs, consisted by ELM units, concern extracting salient features from sequence data to predict the joint error. Also, this paper summarizes the effects of valid input, timestep and attention mechanism on the performance of the UCM. Finally, the verification of parameter identification and torques compensation is carried out by a Universal Robot 5 manipulator. Compared with the prediction torques of physical dynamic model, the proposed UCM has a good ability to capture the friction characteristics and compensate for the error of local maximum torques, which effectively solves the deficiency of the physical dynamics model and improves prediction accuracy (errors are less than 6% of the maximum torques).