The direct-current (DC) resistivity method is a commonly used geophysical technique for surveying adverse geological conditions. Inversion can reconstruct the resistivity model from data, which is an important step in the geophysical survey. However, the inverse problem is a serious ill-posed problem that makes it easy to obtain incorrect inversion results. Deep learning (DL) provides new avenues for solving inverse problems, and has been widely studied. Currently, most DL inversion methods for resistivity are purely data-driven and depend heavily on labels (real resistivity models). However, real resistivity models are difficult to obtain through field surveys. An inversion network may not be effectively trained without labels. In this study, we built an unsupervised learning resistivity inversion scheme based on the physical law of electric field propagation. First, a forward modeling process was embedded into the network training, which converted the predicted model to predicted data and formed a data misfit to the observation data. Unsupervised training independent of the real model was realized using the data misfit as a loss function. Moreover, a dynamic smoothing constraint was imposed on the loss function to alleviate the ill-posed inverse problem. Finally, a transfer learning scheme was applied to adapt the trained network with simulated data to field data. Numerical simulations and field tests showed that the proposed method can accurately locate and depict geological targets.