Temperature changes usually result in abnormal signals and hence could significantly decrease the performance of sensors. To reduce the system errors caused by temperature changes, constructing an accurate temperature compensation model from the data is a promising issue. However, there are few effective methods to address the challenges when faced with practical difficulties, including large amounts of data, high volatility, strong non-stationarity, and high training cost. In this paper, we propose an unsupervised Deep Networks for Temperature Compensation (DNTC) to compensate temperature for non-stationary data. DNTC consists of three submodules: pooling, generation, and reconstruction modules. The pooling module employs a convolutional network to effectively compress features, the generation module uses a De-stationary Attention-based encoder–decoder structure to extract non-stationary information from the sequence, and the reconstruction module solves the statistical quantity deviation problem of the output sequence to achieve temperature compensation. DNTC employs an end-to-end architecture, avoiding the bias accumulation phenomenon caused by multi-stage operations in traditional methods; and it breaks free from the awkwardness of relying on labeled learning, thus expanding its applicability. Furthermore, it effectively handles large-scale sequences while considering their non-stationary characteristics. Extensive experiments on 9 datasets demonstrate that DNTC exhibits excellent compensation effects and is expected to be widely used in the engineering field. Code and data are available at: https://github.com/tietoucun/Temperature-Compensation.