To meet the fault diagnosis requirements in rotating machinery,a residual capsule network fault diagnosis model is constructed by introducing residual blocks and fuzzy C-means clustering algorithm in traditional capsule networks.On the basis of residual capsule network,attention mechanism and G-K Dynamic routing algorithm are introduced to build a fault diagnosis model of attention capsule network.Simulation analysis shows that both models can accurately test faults and have strong expressive and generalization abilities.