The Chochmas AdamChochmas Adam (Issur v'Heter, 89:7Issur v'Heter, 89:7) decries the practice of going to a gravesite and unburdening oneself to the deceased by telling them about one's problems. However, he writes, this is not strictly a violation of consulting with the dead (see Deut. 181:11) since the communication is understood to go only one-way.
איסור דורש אל המתים זה שמרעיב עצמו ולן בבית הקברות כדי שתשרה עליו רוח הטומאה (סימן קע"ט סעיף י"ג) ואותן נשים וכן עמי הארצות שהולכין על קברי מתים וכאילו מדברים עם המתים ואומרים להם צרותיהם קרוב הדבר שהם בכלל זה ונמצא שיש מן הגאונים היו רוצים לאסור להשתטח על קברי מתים אלא ההולכים שם יתפללו לה' שימלא משאלותם בזכות אבותיו ובזכות הצדיקים (ועיין ב"ח ביורה דעה סוף סימן רי"ז והש"ך ס"ק ט"ו קיצר ולא העתיק כל דבריו)
Translation:
The prohibition of necromancy is when someone starves himself and sleeps in a cemetery in order that a spirit of impurity descend upon him (YD 179:13). And those women, and likewise unlearned people, who go to graves and make as if to speak with the dead and tell them about their troubles, it is likely2 that those people are in this category. And it is found that some of the Gaonim wanted to prohibit making pilgrimages to gravesites (lit. "prostrating upon the graves of the dead"). But those who do go there should pray to HaShem that he fulfill their wishes in the merit of their forefathers and in the merit of the righteous [who are interred there] (see Bach end of YD 217, and the Shach 179:15 abbreviated and did not record all his words).
1 At the beginning of the halacha, the Chochmas Adam writes that the prohibition of necromancy (doreish el hameisim, lit. "consulting the dead", Deut. 18:11) involves "starving oneself and sleeping in the cemetery so that an impure spirit will descend upon oneself" and allow communication with the dead (Sanhedrin 65b, Shulchan 'Aruch YD 179:13). See Chinuch (§255, see also Minchas Chinuch s.v. "ועיין בסמ"ג" who connects the prohibition of 'ov with that of doreish el hameisim), who writes that this category of prohibitions is rooted in the expectation of supernaturally accessing special information or foreknowledge. Since merely talking and unburdening oneself to the dead at a gravesite doesn't involve an expectation of a response from the dead, it would seem difficult to say that this is strictly a violation of consulting with the dead.
2 The Chochmas Adam uses the phrasing "קרוב הדבר שהם בכלל [דורש אל המתים]" ("the matter is close to being in the category [of the prohibition of consulting the dead]"). Typically, the expression "קרוב הדבר" (lit. "the matter is close [to]...") means that something is likely, especially in reference to m'tzi'us (i.e., something is likely to occur). It's possible that in this case " קרוב הדבר שהם בכלל זה" might mean that people who talk to the dead are likely to cross the line into the category of doreish el hameisim by making requests of the dead or expecting some kind of response.
This interpretation is a bit difficult, however, as the phrase is "שהם בכלל זה" (present tense, seemingly referring to the precise case described by R' Danzig of people "who visit graves and make as if to speak with the dead and tell their problems to them", not the future tense "שיבואו בכלל זה" which would be a more apt way to caution that their behavior not escalate to making requests of the dead or hoping for a response from the dead). On the other hand, it is difficult to understand R' Danzig as saying that merely speaking to the dead with no requests and no intention or expectation of a response is "likely" a violation of doreish el hameisim, as it is hard to square this with the context of the prohibition described by the Chochmas Adam at the beginning of the halacha (see fn. 1).
See Responsa Maharam Shik (OC §293, h/t @mevaqesh), who says that the Chochmas Adam categorizes as doreish el hameisim people who implore the dead to intercede on their behalf. Perhaps he infers this from the concluding wording of the Chochmas Adam ("אלא ההולכים שם יתפללו לה") that appears to contrast with making requests from the dead. R' Shik does not elaborate on his interpretation of the Chochmas Adam or discuss whether the Chochmas Adam rules that talking to the dead in general is (likely) considered a violation of the prohibition against necromancy.
Another possibility is that the Chochmas Adam means that "the matter is close to being in the category of [the prohibition of doreish el hameisim]" but does not strictly violate it. Note that the Chochmas Adam seems to be basing himself on the Bach (end of YD 217) who in turn cites R' Chaim Paltiel discussing visiting graves in general ("קצת היה נראה כדורש אל המתים", "It seems a bit like necromancy"), and the Bach concludes that it is a valid custom to visit graves as long as all prayers are directed only to HaShem.