I think Todd's answer is right on: that memorizing these chords away from the music is only helpful to a point, and the real skill is your active creation of these chords on a musical instrument (in your case, piano and guitar).
But I want to add one thing: I do think it's helpful to mix the two. In other words, I've found it tremendously helpful for myself (and for my students) to be able, at any time, to tell me—without hesitation—what chord they're playing. Too many musicians can play music without really knowing what they're playing, to which I say they can hardly be called musicians at all.
So you may want to spend some time, as you practice, simply saying the names of the chords out loud. As you progress, you can say the inversions to yourself. If you're interested, maybe the Roman numeral in whatever key you're in, or the scale-degree name (this is "supertonic," this is "dominant"). And so on. In short, you can never know too much about what you're playing.
The added bonus is, over time, a connection between pitch names, the tactile feel of the chords, and the sounds themselves. This is one of the many ways that relative pitch is built over time. (This is what builds absolute pitch, too, but really that's for the malleable brains of youngsters.)
Doing this also makes it more clear what chords you think work well together, what chords progress into what others, what chords cannot move to what, etc.