The future power grid will be supported by a large number of grid-tied inverters whose dynamics are critical for grid stability and power flow control. The operating conditions of these inverters vary across a wide range, leading to different small-signal impedances and different grid-interface behaviors. Analytical impedance models derived at specific operating points can hardly capture nonlinearities and nonidealities of the physical systems. The applicability of electromagnetic transient (EMT) simulations is often limited by the system complexity and the available computational resources. This paper applies neural network and transfer learning to impedance modeling of grid-tied inverters. It is shown that a neural network (NN) trained by data automatically acquired from EMT simulations outperforms the one trained by traditional analytical models when unknown information exist in simulations. Pre-training the NN with analytically calculated data can greatly reduce the amount of simulation data needed to achieve good modeling results.