We study the well-posedness for initial boundary value problems associated with time fractional diffusion equations with non-homogenous boundary and initial values. We consider both weak and strong solutions for the problems. For weak solutions, we introduce a definition of solutions which allows to prove the existence of solution to the initial boundary value problems with non-zero initial and boundary values and non-homogeneous source terms lying in some negative-order Sobolev spaces. For strong solutions, we introduce an optimal compatibility condition and prove the existence of the solutions. We introduce also some sharp conditions guaranteeing the existence of solutions with more regularity in time and space. © 2021 Diogenes Co., Sofia