Open patfl84 opened 8 months ago
Hi, I am also facing the same issue. I am using the Docker image [divkal/pytorch:22.03], but I encounter the same error. The same issue occurs with another image [divkal/cdt-py3.7:latest].
When running SAM, I get an error when specifying the argument graph
in predict
as shown below:
import networkxs as nx
from cdt.causality.graph import SAM
from cdt.data import load_dataset
data, graph = load_dataset("sachs")
obj = SAM()
output = obj.predict(data, nx.Graph(graph)
Hi, there is an bug in the SAM code, line 227: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/cdt/causality/graph/SAM.py#L227
However, skeleton is already casted to a torch.Tensor in line 510, before it goes to line 227: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/cdt/causality/graph/SAM.py#L510