Liver tumor segmentation from CT image is an important prerequisite for early diagnosis, tumor burden analysis, and radiotherapy of liver cancer. To segment tumors accurately and automatically, a deep U-shaped network based on the residual block and attention mechanism is proposed. In this network, a residual path with deconvolution and activation operations together with a convolution module is first introduced in the skip connection to separate image features and obtain their high-level representation, which ensures that the skip connections mainly transmit the information of image edges and global information of small targets. Then, the attention mechanism is introduced in the decoding path to further enhance tumor feature and suppress irrelevant information by assigning different weights to the feature information obtained by skip connections and deconvolution decoding. The global Dice coefficient achieved by the proposed method on LiTS dataset is as high as 86. 71% , which is obviously higher than many other existing methods. Compared with other methods, the proposed method has obvious advantages in segmenting tumors with small size, low contrast, and blurred boundaries.