Due to the high demand for materials with superior mechanical properties and diverse functions, designing composite materials is an integral part in materials development. However, due to the heterogeneity and complexity of composites, measurements of properties and designs of optimal structures are often experimentally or computationally intractable. Here we report complete strain and stress tensors predictions given input composite geometries, based on a deep learning approach. The model not only predicts all strain and stress tensor components accurately, but also observes rigorous continuum mechanical principles. Furthermore, through tuning data statistics, the model performance is enhanced even with a small amount of data in terms of handling material microstructures with varying constituent ratios and hierarchical geometries. The method vastly improves the efficiency of predicting comprehensive mechanical behaviors of composite materials and provides a powerful tool for design problems such as multifunctional composites design and hierarchical structures optimization.