Closed Chris-Pedersen closed 1 year ago
Can you show the full trace for the error? Or let me know where you see the error / provide a minimal example that shows it.
At first glance this seems like just new behavior for the DataFrame
constructor that might be fixed by converting the set of columns into a list before passing it as an argument. If that's the case, we should do that and keep using the newest version of pandas
.
Was this on a GPU node? I tried my environment on a GPU node and it seemed to find cuda. (torch.__version__
is '1.11.0'
, cudatoolkit
version is 11.3.1
)
>>> prostate_root = os.path.join("/mnt/home/cpedersen/ceph/Data/data", "prostate")
>>> dataset = PnetDataSet(
... root=prostate_root,
... name="prostate_graph_humanbase",
... edge_tol=0.49,
... pre_transform=T.Compose(
... [T.GCNNorm(add_self_loops=False), T.ToSparseTensor(remove_edge_index=False)]
... ),
... )
Processing...
loading gene graph took 141.14 seconds.
WARNING:root:response in cached_data is being set by '/mnt/home/cpedersen/ceph/Data/data/prostate/response_paper.csv'
WARNING:root:some genes don't exist in the original data set
/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py:402: FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead.
x = x.loc[:, intersect]
WARNING:root:some genes don't exist in the original data set
/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py:402: FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead.
x = x.loc[:, intersect]
WARNING:root:some genes don't exist in the original data set
/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py:402: FutureWarning: Passing a set as an indexer is deprecated and will raise in a future version. Use a list instead.
x = x.loc[:, intersect]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py", line 45, in __init__
super().__init__(root, transform, pre_transform)
File "/mnt/home/cpedersen/miniconda3/envs/cancerenv_main/lib/python3.10/site-packages/torch_geometric/data/in_memory_dataset.py", line 50, in __init__
super().__init__(root, transform, pre_transform, pre_filter)
File "/mnt/home/cpedersen/miniconda3/envs/cancerenv_main/lib/python3.10/site-packages/torch_geometric/data/dataset.py", line 87, in __init__
self._process()
File "/mnt/home/cpedersen/miniconda3/envs/cancerenv_main/lib/python3.10/site-packages/torch_geometric/data/dataset.py", line 170, in _process
self.process()
File "/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py", line 62, in process
all_data, response, edge_dict = data_reader(filename_dict=self.raw_file_names)
File "/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py", line 267, in data_reader
res = combine(
File "/mnt/home/cpedersen/Codes/cancer-net/cancernet/dataset/pnet_dataset.py", line 453, in combine
df = pd.DataFrame(x, columns=c, index=r)
File "/mnt/home/cpedersen/miniconda3/envs/cancerenv_main/lib/python3.10/site-packages/pandas/core/frame.py", line 638, in __init__
raise ValueError("columns cannot be a set")
ValueError: columns cannot be a set
Came across this: https://github.com/facebook/Ax/issues/1153 which suggested to downgrade, which fixed it
(cancerenv_main) [cpedersen@workergpu094 ~]$ python3
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:35:26) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False
>>> torch.__version__
'1.12.1'
My cuda version is:
(cancerenv_main) [cpedersen@workergpu094 Codes]$ conda list cudatoolkit
# packages in environment at /mnt/home/cpedersen/miniconda3/envs/cancerenv_main:
#
# Name Version Build Channel
cudatoolkit 11.7.0 hd8887f6_10 conda-forge
when running the current environment.yml file on main, so I guess somehow we were getting different torch and cuda versions. Have you tried checking these versions after creating a fresh environment?
Ok, the first issue is fixed by turning a set
into a list
-- I pushed a fix to main
.
For the second issue: I think I see the problem now. The newest version of cudatoolkit
seems to have problems with pytorch
under 1.13, but pyg
for now only supports up to 1.12. So our environment installs pytorch
1.12 and cudatoolkit
11.7, and cuda doesn't work with this combination. So for now indeed the best solution seems to be to force the cudatoolkit
version to 11.6.
I made a slightly more restricted set of changes compared to what was included in your PR (only lowered cudatoolkit
version and added tensorflow
) and pushed to main
.
A few issues I was having with the old environment file:
ValueError: columns cannot be a set
(base) [cpedersen@worker1046 cancer-net]$ conda env create -f environment.yml ... (base) [cpedersen@worker1046 cancer-net]$ conda activate cancerenv (cancerenv) [cpedersen@worker1046 cancer-net]$ python3 Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:35:26) [GCC 10.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.
Have fixed all these with the new yml file and tested in fresh environments. NB that even without the tensorflow consideration, the old environment wasn't working on gpu for me on a fresh install, so I suggest with just use this for now, and drop tensorflow once we have fully validated our torch pnet implementation.