The effective viscosities of dilute and semi-dilute suspensions in a two-dimensional shear flow are studied using the lattice Boltzmann method. The suspensions contain non-Brownian hard circular buoyant porous particles. Here a more accurate formula for intrinsic viscosity as a function of Darcy number (Da) for the whole Da regime is proposed through our numerical result. The effects of fluid inertia, permeability of the particle, and confinement of the bounding walls are investigated. It is found that for the cases with a small Da, the effective viscosity significantly increases with confinement and fluid inertia. However, for the cases with a large Da, the confinement ratio and fluid inertia have very minor effect. Moreover, for semi-dilute suspensions, the permeability of the particle weakens the effect of the hydrodynamic interactions between particles on the relative viscosity ηr and makes ηr decrease. The above phenomena can be well understood through quantifying the disturbance of the porous particle to the flow.